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/data-types.md
+14-4Lines changed: 14 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -56,10 +56,6 @@ Because all data types support *blank*, the **Boolean** and **Two option** data
56
56
57
57
All four of these data types are based on a [Unicode](https://en.wikipedia.org/wiki/Unicode) text string.
58
58
59
-
### Size limits
60
-
61
-
These data types have no preset limit on their length. The underlying JavaScript implementation in your browser or on your device may impose a limit, but it's usually well over 100 MB. However, the amount of available memory on your device may impose another limit that's likely lower than 100 MB. To determine whether your app will run within these limits, test common scenarios on all devices on which it should run.
62
-
63
59
### Image and Media resources
64
60
65
61
Through the **File** menu, you can add image, video, and audio files as app resources. The name of the imported file becomes the resource name in the app. In this graphic, the Northwind Traders logo, which is named **nwindlogo**, has been added to an app:
@@ -94,6 +90,16 @@ You use a URI to reference an image or another media file stored in a database.
94
90
95
91
When you save a media data type, such as an image, to a database, the app sends the actual image or media data, not the URI reference.
96
92
93
+
### Size limits
94
+
95
+
As text string and URIs, these data types have no preset limit on their length.
96
+
97
+
The binary data that these data types reference also has no preset limit on size. For example an image captured through the camera control that is now referenced as **"appres://..."** can be as large and high resolution as the camera can muster. The resolution, frame rate, and other attributes of media files are not limited by the data type, but specific controls for playing and capturing media may have their own limitations.
98
+
99
+
However, all data sizes are subject to the amount of available memory in the app. Typically browsers running on a desktop computer will support more than 100 megabyteas of data. However, the amount of available memory on a device such as a phone may be far lower, typically in the range 30-70 megabytes. To determine whether your app will run within these limits, test common scenarios on all devices on which it should run.
100
+
101
+
It is a best practice to only hold data in memory as long as you need to. Upload images to a database as soon as you can; download images only when requested by the app's user.
102
+
97
103
## Number and Currency
98
104
99
105
**Number** and **Currency** data types use the [IEEE 754 double-precision floating-point standard](https://en.wikipedia.org/wiki/IEEE_754). This standard provides a very large range of numbers in which to work, from –1.79769 x 10<sup>308</sup> to 1.79769 x 10<sup>308</sup>. The smallest value that can be represented is 5 x 10<sup>–324</sup>.
@@ -147,6 +153,10 @@ For example, Unix time shows September 9, 2001, at 01:46:40 UTC as 1,000,000,000
147
153
148
154
However, that function returns **Saturday, September 8, 2001 18:46:40** if you use the **DateTimeFormat.LongDateTime24** format in a time zone that's -7 hours offset from UTC (7 hours west of UTC). This result shows the **DateTime** value correctly based on the local time zone.
149
155
156
+
To convert to a Unix time, take the result from **Value** and divide by 1,000: **RoundDown( Value( UnixTime ) / 1000, 0 )**.
157
+
158
+
If you need the Unix time in a Date value for further calculations or display within PowerApps, use the formula **DateAdd( Date( 1970,1,1 ), UnixTime, Seconds )**.
159
+
150
160
### SQL Server
151
161
152
162
SQL Server has [**Datetime**, **Datetime2**, and other date/time data types](https://docs.microsoft.com/sql/t-sql/functions/date-and-time-data-types-and-functions-transact-sql?view=sql-server-2017) that don't include a time-zone offset and don't indicate which time zone they're in. Canvas apps assume these values are stored in UTC and treat them as **User local**. If the values are meant to be time-zone independent, correct for the UTC translations by using the [**TimeZoneOffset**](function-dateadd-datediff.md#converting-to-utc) function.
Use the **[Split](function-split.md)** function to split a string into a table of substrings.
25
+
Use the [**Split** function](function-split.md) or [**MatchAll** function](function-ismatch.md) to split a string into a table of substrings.
26
26
27
-
The **Concatenate** function concatenates a mix of individual strings and a single-column table of strings. Used with individual strings, this function is equivalent to using the **&**[operator](operators.md). You can use a formula that includes the **[ShowColumns](function-table-shaping.md)** function to create a single-column table from a table that has multiple columns.
27
+
The **Concatenate** function concatenates a mix of individual strings and a single-column table of strings. Used with individual strings, this function is equivalent to using the **&**[operator](operators.md).
28
28
29
29
## Syntax
30
30
**Concat**( *Table*, *Formula* )
@@ -37,25 +37,73 @@ The **Concatenate** function concatenates a mix of individual strings and a sing
37
37
**String(s)* - Required. Mix of individual strings or a single-column table of strings.
38
38
39
39
## Examples
40
-
#### Concat
41
-
1. Add a **[Button](../controls/control-button.md)** control, and set its **[OnSelect](../controls/properties-core.md)** property to this formula:
2. Press F5, click the button, and then press Esc to return to the design workspace.
45
-
3. Add a **[Label](../controls/control-text-box.md)** control, and set its **[Text](../controls/properties-core.md)** property to this formula:
46
-
47
-
**Concat(Products, String & " ")**
48
-
49
-
The label shows **Violin Cello**.
50
-
51
-
#### Concatenate
52
-
1. Add a **[Text input](../controls/control-text-input.md)** control, and name it **AuthorName**.
53
-
2. Add a **[Label](../controls/control-text-box.md)** control, and set its **[Text](../controls/properties-core.md)** property to this formula:<br>
54
-
**Concatenate("By ", AuthorName.Text)**
55
-
3. Type your name in **AuthorName**.
56
-
57
-
The label shows **By** followed by your name.
58
-
59
-
If you had an **Employees** table that contained a **FirstName** column and a **LastName** column, this formula would concatenate the data in each row of those columns.
To create these global variables in an app, insert a button control and set its **OnSelect** property to
50
+
```powerapps-dot
51
+
Set( FirstName, "Jane" ); Set( LastName, "Doe" );
52
+
Set( Products,
53
+
Table(
54
+
{ Name: "Violin", Type: "String" },
55
+
{ Name: "Cello", Type: "String" },
56
+
{ Name: "Trumpet", Type: "Wind" }
57
+
)
58
+
)
59
+
```
60
+
Select the button (hold down the Alt key while clicking the button).
61
+
62
+
### Concatenante function and & operator
63
+
64
+
| Formula | Description | Result |
65
+
|---------|-------------|--------|
66
+
|`Concatenate( LastName, ", ", FirstName )`| Concatenates the value in **LastName**, the string **", "** (a comma followed by a space), and the value in **FirstName**. | "Doe, Jane" |
67
+
|`LastName & ", " & FirstName`| Same as the previous example, using the **&** operator instead of the function. | "Doe, Jane" |
68
+
|`Concatenate( FirstName, " ", LastName )`| Concatenates the value in **FirstName**, the string **" "** (a single space), and the value in **LastName**. | "Jane Doe" |
69
+
|`FirstName & " " & LastName`| Same as the previous example, using the **&** operator instead of the function. | "Jane Doe" |
70
+
71
+
### Concatenate with single column table
72
+
73
+
| Formula | Description | Result |
74
+
|---------|-------------|--------|
75
+
|`Concatenate( "Name: ", Products.Name, ", Type: ", Products.Type )`| For each record in the **Products** table, concatenates the string **"Name: "**, the name of the product, the string **", Type: "** and the type of the product. ||
76
+
77
+
### Concat function
78
+
79
+
| Formula | Description | Result |
80
+
|---------|-------------|--------|
81
+
|`Concat( Products, Name & ", " )`| Evaluates the formula **Name & ", "** for each record of **Products** and concatenates the results together into a single text string. | "Violin, Cello, Trumpet, " |
82
+
|`Concat( Filter( Products, Type = "String" ), Name & ", " )`| Evaluates the formula **Name & ", "** for each record of **Products** that satifies the filter **Type = "String"** and concatenates the results together into a single text string. | "Violin, Cello, " |
83
+
84
+
### Trimming the end
85
+
86
+
Note that in the last two example an extra ", " is included at the end of the result. This is because for each record of the table the function extracts the **Name** and adds a ", " to the end, no matter if it is the first record or the last.
87
+
88
+
In some cases these extra characters won't matter, for example if a single space separator is used and the result is displayed in a label. For situations where these extra characters needs to be removed, you can use the [**Left** function](function-left-mid-right.md) or the [**Match** function](function-ismatch.md):
89
+
90
+
| Formula | Description | Result |
91
+
|---------|-------------|--------|
92
+
|`Left( Concat( Products, Name & ", " ), Len( Concat( Products, Name & ", " ) ) - 2 )`| Returns the result of **Concat** but removes the last two characters, the extra separator that is not desired. | "Violin, Cello, Trumpet" |
93
+
|`Match( Concat( Products, Name & ", " ), "^(?<trim>.*), $" ).trim`| Returns the characters of **Concat** from the beginning of the text string (^) to the end ($) but does not include the unwanted comma and space at the end. | "Violin, Cello, Trumpet" |
94
+
95
+
### Split and MatchAll
96
+
97
+
The **Split** and **MatchAll** functions can be used to reverse **Concat** when used with a separator.
98
+
99
+
| Formula | Description | Result |
100
+
|---------|-------------|--------|
101
+
|`Split( Concat( Products, Name & ", " ), ", " )`| Splits the text string with the separator **", "**. Since there is a comma and space at the end of the string, this becomes an extra row in the result with an empty string. ||
102
+
| `MatchAll( Concat( Products, Name & ", " ), "[^\s,]+" ).FullMatch` | Splits the text string based on characters that are not a space or a comma. In this case, the extra comma and space at the end of the string is automatically removed. | 
Copy file name to clipboardExpand all lines: powerapps-docs/maker/canvas-apps/functions/function-len.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ Returns the length of a string of text.
20
20
## Description
21
21
If you specify a single string as the argument, the return value is the length as a number. If you specify a single-column [table](../working-with-tables.md) that contains strings, the return value is a single-column table that contains the length of each string. If you have a multi-column table, you can shape it into a single-column table, as [working with tables](../working-with-tables.md) describes.
22
22
23
-
If you specify an [empty](function-isblank-isempty.md) string, **Len** returns 0.
23
+
If you specify a [blank](function-isblank-isempty.md) string, **Len** returns 0.
Copy file name to clipboardExpand all lines: powerapps-docs/maker/canvas-apps/functions/function-logicals.md
+58-12Lines changed: 58 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.service: powerapps
7
7
ms.topic: reference
8
8
ms.custom: canvas
9
9
ms.reviewer: anneta
10
-
ms.date: 11/07/2015
10
+
ms.date: 05/23/2019
11
11
ms.author: gregli
12
12
search.audienceType:
13
13
- maker
@@ -18,11 +18,38 @@ search.app:
18
18
Boolean logic functions, commonly used to manipulate the results of comparisons and tests.
19
19
20
20
## Description
21
-
The **And** function returns **true** if all of its arguments are **true**. The **&&**[operator](operators.md) is equivalent to **And**.
21
+
The **And** function returns **true** if all of its arguments are **true**. With two arguments:
22
22
23
-
The **Or** function returns **true** if any of its arguments are **true**. The **||** operator is equivalent to **Or**.
23
+
| First argument | Second argument | Result |
24
+
| ---------- | -------------- | --------|
25
+
|*false*|*false*|*false*|
26
+
|*false*|*true*|*false*|
27
+
|*true*|*false*|*false*|
28
+
|*true*|*true*|*true*|
24
29
25
-
The **Not** function returns **true** if its argument is **false**; it returns **false** if its argument is **true**. The **!** operator is equivalent to **Not**.
30
+
The **Or** function returns **true** if any of its arguments are **true**. With two arguments:
31
+
32
+
| First argument | Second argument | Result |
33
+
| ---------- | -------------- | --------|
34
+
|*false*|*false*|*false*|
35
+
|*false*|*true*|*true*|
36
+
|*true*|*false*|*true*|
37
+
|*true*|*true*|*true*|
38
+
39
+
The **Not** function returns **true** if its argument is **false**; it returns **false** if its argument is **true**. It always takes one argument:
40
+
41
+
| Argument | Result |
42
+
| -------- | ------ |
43
+
|*false*|*true*|
44
+
|*true*|*false*|
45
+
46
+
These logical functions are consistent with Excel. You can also use [operators](operators.md) to perform these same operations, using either Visual Basic or JavaScript syntax:
These functions work with logical values. They can't be passed a number or a string directly; instead a comparison or test must be made. For example, a comparison such as **x > 1** is a logical formula that evaluates to the Boolean value **true** if **x** is greater than **1**. If **x** is less than **1**, the formula evaluates to **false.**
28
55
@@ -34,18 +61,37 @@ These functions work with logical values. They can't be passed a number or a str
34
61
**LogicalFormula(s)* - Required. Logical formulas to evaluate and operate on.
35
62
36
63
## Examples
37
-
### Step by step
38
-
Use this function to determine whether a slider's value falls outside the 50 to 100 range:
39
64
40
-
**Or(Slider1.Value < 50, Slider1.Value> 100)**
65
+
The examples in this section use the following global variables:
41
66
42
-
If a [table](../working-with-tables.md) contained a **Dept**[column](../working-with-tables.md#columns) and a **Salary** column, you could use this function in a **Result** column to show **true** in all rows in which the value in the **Dept** column was **HR** or the value in the **Salary** column was larger than **200000**:
67
+
| Global variable | Value |
68
+
| --------------- | ----- |
69
+
|**a**|*false*|
70
+
|**b**|*true*|
71
+
|**x**|**10**|
72
+
|**y**|**100**|
73
+
|**string**|**"hello world"**|
43
74
44
-
**Or(Dept = HR, Salary >= 200000)**
75
+
To create these global variables in an app, insert a button control and set its **OnSelect** property to
Select the button (hold down the Alt key while clicking the button).
45
80
46
-
As an alternative, use the || operator to get the same results as what the previous formulas return:
81
+
| Formula | Description | Result |
82
+
|---------|-------------|--------|
83
+
|**And( a, b )**| Tests the values of **a** and **b**. Since one of the arguments is *false*, the function returns *false*|*false*|
84
+
|**a And b**| Same as the previous example, using Visual Basic notation |*false*|
85
+
|**a && b**| Same as the previous example, using JavaScript notation |*false*|
86
+
|**Or( a, b )**| Tests the values of **a** and **b**. Since one of the arguments is *true*, the function returns *true*|*true*|
87
+
|**a Or b**| Same as the previous example, using Visual Basic notation |*true*|
88
+
|**a || b**| Same as the previous example, using JavaScript notation |*true*|
89
+
|**Not( a )**| Tests the value of **a**. Since the argument is *false*, the function returns the opposite *true*|*true*|
90
+
|**Not a**| Same as the previous example, using Visual Basic notation |*true*|
91
+
|**! a**| Same as the previous example, using JavaScript notation |*true*|
92
+
|**Len( string ) < 20 And Not IsBlank( string )**| Tests if the length of **string** is less than 20 and if it is not a **blank** value. Since the length is less than 20 and it is not blank, the result is *true*|*true*|
93
+
|**Or( Len( string ) < 10, x < 100, y < 100 )**| Tests if the length of **string** is less than 10 which is *false*, if **x** is less than 100 which is *true*, and if y is less than 100 which is *false*. Since one of the arguments to **Or** is *true*, the function returns *true*. |*true*|
94
+
|**Not IsBlank( string )**| Test if **string** is *blank* which returns *false*. **Not** returns the opposite of this result which is *true*. |*true*|
Copy file name to clipboardExpand all lines: powerapps-docs/maker/canvas-apps/functions/function-text.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -170,7 +170,7 @@ Unless otherwise specified, the user running these formulas is located in the Un
170
170
|**Text( Now(), DateTimeFormat.LongTime24 )**|Formats as a long time string, using a 24-hour clock. |"14:37:47" |
171
171
|**Text( Now(), DateTimeFormat.ShortDate )**|Formats as a short date string, in the language and locale of the current user. |"11/23/2015" |
172
172
|**Text( Now(), "d-mmm-yy" )**|Formats using placeholder characters: <ul><li>**d** for a single-digit or double-digit day of the month<li>**-** as a literal character copied to the result<li>**mmm** for a three-letter abbreviation of the month<li>**-** as another literal character copied to the result<li>**yy** for a two-digit abbreviation of the year</ul> |"23-Nov-15" |
173
-
|**Text(1448318857000, "mmm. dd, yyyy (hh:mm:ss AM/PM)")**| Shows a Unix date-time value in human-readable format if you multiply the source value by 1,000. | "Nov. 23, 2015 (02:47:37 PM)" |
173
+
|**Text(1448318857*1000, "mmm. dd, yyyy (hh:mm:ss AM/PM)")**| Shows a Unix date-time value in human-readable format if you multiply the source value by 1,000. | "Nov. 23, 2015 (02:47:37 PM)" |
0 commit comments