You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: powerapps-docs/maker/canvas-apps/functions/function-colors.md
+9-6Lines changed: 9 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -15,18 +15,21 @@ search.app:
15
15
- PowerApps
16
16
---
17
17
# Color enumeration and ColorFade, ColorValue, and RGBA functions in PowerApps
18
+
18
19
Using built in color values, defining custom colors, and Alpha blending.
19
20
20
21
## Description
21
-
The **Color** enumeration is an easy way to access the colors defined by HTML's Cascading Style Sheets (CSS). For example, **Color.Red** returns a pure red color. The list of these colors is included at the end of this article.
22
+
23
+
The **Color** enumeration is an easy way to access the colors defined by HTML's Cascading Style Sheets (CSS). For example, **Color.Red** returns a pure red color. The list of these colors is included at the end of this article.
22
24
23
25
The **ColorValue** function returns a color based on a CSS color string. Both names of CSS colors such as "RosyBrown" and hex values such as "#bc8f8f" may be used.
24
26
25
-
The **RGBA** function returns a color based on Red, Green, and Blue color components. It also includes an Alpha component used for mixing colors of objects layered on top of one another. Alpha varies from 0 or 0% which is fully transparent and invisible to 1 or 100% which is fully opaque and completely blocks out layers below.
27
+
The **RGBA** function returns a color based on Red, Green, and Blue color components. It also includes an Alpha component used for mixing colors of objects layered on top of one another. Alpha varies from 0 or 0% which is fully transparent and invisible to 1 or 100% which is fully opaque and completely blocks out layers below.
26
28
27
-
The **ColorFade** function returns a brighter or darker version of a color. The amount of fade varies from -1 or -100% which fully darkens a color to black, to 0 which has no impact on the color, to 1 or 100% which fully brightens a color to white.
29
+
The **ColorFade** function returns a brighter or darker version of a color. The amount of fade varies from -1 or -100% (which fully darkens a color to black) to 0 (which has no impact on the color) to 1 or 100% (which fully brightens a color to white).
28
30
29
31
## Syntax
32
+
30
33
**Color**.*ColorName*
31
34
32
35
**ColorName* - Required. A Cascading Style Sheet (CSS) color name. See list below of possible enumeration values.
@@ -38,14 +41,14 @@ The **ColorFade** function returns a brighter or darker version of a color. The
38
41
**RGBA**( *Red*, *Green*, *Blue*, *Alpha* )
39
42
40
43
**Red*, *Green*, *Blue* - Required. Color component values, ranging from 0 (no saturation) to 255 (full saturation).
41
-
**Alpha* - Required. Alpha component, ranging from 0 (fully transparent) to 1 (fully opaque). You can also use a percentage, 0% to 100%.
44
+
**Alpha* - Required. Alpha component, ranging from 0 (fully transparent) to 1 (fully opaque). You can also use a percentage, 0% to 100%.
42
45
43
46
**ColorFade**( *Color*, *FadeAmount* )
44
47
45
48
**Color* - Required. A color value such as **Color.Red** or the output from **ColorValue** or **RGBA**.
46
-
**FadeAmount* - Required. A number between -1 and 1. -1 fully darkens a color to black, 0 has no impact on the color, and 1 fully brightens a color to white. You can also use a percentage, -100% to 100%
49
+
**FadeAmount* - Required. A number between -1 and 1. -1 fully darkens a color to black, 0 has no impact on the color, and 1 fully brightens a color to white. You can also use a percentage from -100% to 100%
47
50
48
-
## Builtin colors
51
+
## Built-in colors
49
52
50
53
| Color enumeration | ColorValue with Hex Code | RGBA | Color Swatch |
Copy file name to clipboardExpand all lines: powerapps-docs/maker/canvas-apps/functions/function-iferror.md
+18-16Lines changed: 18 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -14,53 +14,55 @@ search.audienceType:
14
14
search.app:
15
15
- PowerApps
16
16
---
17
+
17
18
# IfError function in PowerApps
18
19
19
20
Detects errors and provides an alternative value or takes action.
20
21
21
22
## Description
22
23
23
24
> [!NOTE]
24
-
> This function is part of an experimental feature and is subject to change. The behavior described here is only available when the *Formula-level error management* feature is turned on. This is an applevel setting that defaults to off. To turn this feature on, navigate to the *File* tab, *App settings* in the left hand menu, and then *Experimental features*. Your feedback is very valuable to us - please let us know what you think in the [PowerApps community forums](https://powerusers.microsoft.com/t5/Expressions-and-Formulas/bd-p/How-To).
25
+
> This function is part of an experimental feature and is subject to change. The behavior that this topic describes is available only when the *Formula-level error management* feature is turned on. This app-level setting is off by default. To turn this feature on, open the *File* tab, select *App settings* in the left hand menu, and then select *Experimental features*. Your feedback is very valuable to us - please let us know what you think in the [PowerApps community forums](https://powerusers.microsoft.com/t5/Expressions-and-Formulas/bd-p/How-To).
25
26
26
-
The **IfError** function tests one or more values until an error result is found. If an error is found, a corresponding value is returned. If no error is found, a default value is returned. In either case, the returned value might be a string to show, a formula to evaluate, or another form of result. The **IfError** function is very similar to the **If** function: **IfError** tests for errors, while **If** tests for **true**.
27
+
The **IfError** function tests one or more values until it finds an error result . If the function finds an error, the function returns a corresponding value. Otherwise, the function returns a default value. In either case, the function might return a string to show, a formula to evaluate, or another form of result. The **IfError** function resembles the **If** function: **IfError** tests for errors, while **If** tests for **true**.
27
28
28
-
Use **IfError** to replace error values with a valid value. For example, if it is possible that user input may result in a division by zero, replace it with a 0 or other valid value that is appropriate for your app so that downstream calculations can proceed. For example, a simple pattern is:
29
+
Use **IfError** to replace error values with valid values. For example, use this function if user input might result in a division by zero. Build a formula to replace the result with a 0 or another value that's appropriate for your app so that downstream calculations can proceed. Your formula can be as simple as this example:
29
30
30
31
```powerapps-dot
31
32
IfError( 1/x, 0 )
32
33
```
33
34
34
-
If the value of **x**is non-zero, the formula will return **1/x**. However, if **x** is zero, **1/x**will result in an error, and **IfError** will return 0 instead.
35
+
If the value of **x**isn't zero, the formula returns **1/x**. Otherwise, **1/x**produces an error, and the formula returns 0 instead.
35
36
36
-
Use **IfError** in [behavior formulas](../working-with-formulas-in-depth.md) to perform an action and check for an error before continuing to perform additional actions. For example in this pattern:
37
+
Use **IfError** in [behavior formulas](../working-with-formulas-in-depth.md) to perform an action and check for an error before performing additional actions, as in this pattern:
37
38
38
39
```powerapps-dot
39
-
IfError(
40
-
Patch( DS1, ... ), Notify( "problem in the first action" ),
40
+
IfError(
41
+
Patch( DS1, ... ), Notify( "problem in the first action" ),
41
42
Patch( DS2, ... ), Notify( "problem in the second action" )
42
43
)
43
44
```
44
45
45
-
If there is a problem with the **Patch( DS1, ... )** then the first **Notify**will execute and no further processing will occur and **Patch( DS2, ... )** will not happen. But if **Patch( DS1, ... )** succeeds then the second patch will happen, and the second **Notify**executed if there is a problem with it.
46
+
If the first patch encounters a problem, the first **Notify**runs, no further processing occurs, and the second patch doesn't run. If the first patch succeeds, the second patch runs and, if it encounters a problem, the second **Notify**runs.
46
47
47
-
If no errors are found, the value of the optional *DefaultResult*is returned. If that argument is not provided, the value of the last *Value* argument evaluated is returned.
48
+
If the formula doesn't find any errors and you've specified the optional *DefaultResult*argument, the formula returns the value of that you specified for that argument. If the formula doesn't find any errors and you haven't specified that argument, the formula returns the last *Value* argument evaluated.
**Value(s)* - Required. Formula(s) to test for an error value.
53
-
**Fallback(s)* - Required. The formulas to evaluate and values to return if matching *Value* arguments returned an error.
54
-
**DefaultResult* - Optional. The formulas to evaluate if no errors were found.
54
+
**Value(s)* - Required. Formula(s) to test for an error value.
55
+
**Fallback(s)* - Required. The formulas to evaluate and values to return if matching *Value* arguments returned an error.
56
+
**DefaultResult* - Optional. The formulas to evaluate if the formula doesn't find any errors.
55
57
56
58
## Examples
57
59
58
60
| Formula | Description | Result |
59
61
| --- | --- | --- |
60
-
|**IfError( 1, 2 )**|The first argument is not an error. There are no other errors to check and no default return value was provided. The formula returns the last *value* argument evaluated. | 1 |
61
-
|**IfError( 1/0, 2 )**| The first argument is returning an error value (due to division by zero). The second argument is evaluated and returned as the result. | 2 |
62
-
|**IfError( 1/0, Notify( "There was an internal problem", NotificationType.Error ) )**| The first argument is returning an error value (due to division by zero). The second argument is evaluated which displays a messages to the user. The return value of **IfError** is the return value of **Notify**, coerced to the same type as the first argument to **IfError** (a number). | 1 |
63
-
|**IfError( 1, 2, 3, 4, 5 )**| The first argument is not returning an error, so its corresponding fallback is not evaluated. The third argument is not return an error either, so its corresponding fallback is not evaluated. The fifth argument has no corresponding fallback and is the default result which is returned since no errors were found. | 5 |
62
+
|**IfError( 1, 2 )**|The first argument isn't an error. The function has no other errors to check and no default return value. The function returns the last *value* argument evaluated. | 1 |
63
+
|**IfError( 1/0, 2 )**| The first argument returns an error value (due to division by zero). The function evaluates the second argument and returns it as the result. | 2 |
64
+
|**IfError( 1/0, Notify( "There was an internal problem", NotificationType.Error ) )**| The first argument returns an error value (due to division by zero). The function evaluates the second argument and displays a message to the user. The return value of **IfError** is the return value of **Notify**, coerced to the same type as the first argument to **IfError** (a number). | 1 |
65
+
|**IfError( 1, 2, 3, 4, 5 )**| The first argument isn't an error, so the function doesn't evaluate that argument's corresponding fallback. The third argument isn't an error either, so the function doesn't evaluate that argument's corresponding fallback. The fifth argument has no corresponding fallback and is the default result. The function returns that result because the formula contains no errors. | 5 |
0 commit comments