Skip to content

Commit aa9f78c

Browse files
authored
Merge pull request #1634 from MicrosoftDocs/master
Publish: various updates to function/other topics
2 parents 2b1ed0d + 95cd7ce commit aa9f78c

File tree

17 files changed

+288
-134
lines changed

17 files changed

+288
-134
lines changed

powerapps-docs/maker/canvas-apps/create-component.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ So far, you've created a component and added it to an app. Next, you'll create a
179179
## Known limitations
180180
181181
- As of this writing, data sources aren't saved with components, so forms and data tables are disabled.
182-
- If you create a variable in a component, that variable is scoped only to that component and doesn't appear with app variables.
183182
- PowerApps doesn't support collections in components.
184183
- You can't insert a component into a gallery, a form, or a data card.
185184
- A master instance of a component is a local master and scoped to the app. If you change a master instance, only copies of the component within the app will reflect the change. Copies in other apps will remain the same unless you import the component library again. All master instances in those apps will be automatically detected and updated.

powerapps-docs/maker/canvas-apps/functions/data-types.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ Because all data types support *blank*, the **Boolean** and **Two option** data
5656

5757
All four of these data types are based on a [Unicode](https://en.wikipedia.org/wiki/Unicode) text string.
5858

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-
6359
### Image and Media resources
6460

6561
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.
9490

9591
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.
9692

93+
### Size limits
94+
95+
As text strings 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's now referenced as **"appres://..."** can be as large and high resolution as the device's camera can muster. The resolution, frame rate, and other attributes of media files aren't 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. Browsers running on a desktop computer typically support more than 100 megabytes of data. However, the amount of available memory on a device such as a phone might 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+
As a best practice, hold data in memory only as long as necessary. Upload images to a database as soon as you can; download images only when the app's user requests them.
102+
97103
## Number and Currency
98104

99105
**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>.
@@ -115,7 +121,7 @@ Date/time values fall in these categories:
115121

116122
This table shows some examples:
117123

118-
| Date/time type | Value stored in the database | Value displayed and entered 7 hours west of UTC | Value displayed and entered 4 hours east of UTC |
124+
| Date/time type | Value stored in the database | Value displayed and entered 7 hours west of UTC | Value displayed and entered 4 hours east of UTC |
119125
|--------------------------|------------------------------|------------------------------|
120126
| **User local** | Sunday,&nbsp;May&nbsp;19,&nbsp;2019<br>4:00 AM | Saturday,&nbsp;May&nbsp;18,&nbsp;2019<br>9:00 PM | Sunday,&nbsp;May&nbsp;19,&nbsp;2019<br>8:00 AM |
121127
| **Time zone independent** | Sunday,&nbsp;May&nbsp;19,&nbsp;2019<br>4:00 AM | Sunday,&nbsp;May&nbsp;19,&nbsp;2019<br>4:00 AM | Sunday,&nbsp;May&nbsp;19,&nbsp;2019<br>4:00 AM |
@@ -147,6 +153,12 @@ For example, Unix time shows September 9, 2001, at 01:46:40 UTC as 1,000,000,000
147153

148154
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.
149155

156+
To convert to a Unix time, divide the result from **Value** by 1,000:
157+
<br>**RoundDown( Value( UnixTime ) / 1000, 0 )**
158+
159+
If you need the Unix time in a **Date** value for further calculations or display within PowerApps, use this formula:
160+
<br>**DateAdd( Date( 1970,1,1 ), UnixTime, Seconds )**
161+
150162
### SQL Server
151163

152164
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.

powerapps-docs/maker/canvas-apps/functions/function-colors.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,21 @@ search.app:
1515
- PowerApps
1616
---
1717
# Color enumeration and ColorFade, ColorValue, and RGBA functions in PowerApps
18+
1819
Using built in color values, defining custom colors, and Alpha blending.
1920

2021
## 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.
2224

2325
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.
2426

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.
2628

27-
The **ColorFade** function returns a brighter or darker version of a color. The amount of fade varies from -1 which fully darkens a color to black, to 0 which has no impact on the color, to 1 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).
2830

2931
## Syntax
32+
3033
**Color**.*ColorName*
3134

3235
* *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
3841
**RGBA**( *Red*, *Green*, *Blue*, *Alpha* )
3942

4043
* *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%.
4245

4346
**ColorFade**( *Color*, *FadeAmount* )
4447

4548
* *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.
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%
4750

48-
## Built in colors
51+
## Built-in colors
4952

5053
| Color enumeration | ColorValue with Hex Code | RGBA | Color Swatch |
5154
| --- | --- | --- | --- |

powerapps-docs/maker/canvas-apps/functions/function-concatenate.md

Lines changed: 82 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,55 +7,109 @@ ms.service: powerapps
77
ms.topic: reference
88
ms.custom: canvas
99
ms.reviewer: anneta
10-
ms.date: 08/28/2017
10+
ms.date: 05/23/2019
1111
ms.author: gregli
1212
search.audienceType:
1313
- maker
1414
search.app:
1515
- PowerApps
1616
---
1717
# Concat and Concatenate functions in PowerApps
18+
1819
Concatenates individual strings of text and strings in [tables](../working-with-tables.md).
1920

2021
## Description
22+
23+
The **Concatenate** function concatenates a mix of individual strings and a single-column table of strings. When you use this function with individual strings, it's equivalent to using the **&** [operator](operators.md).
24+
2125
The **Concat** function concatenates the result of a formula applied across all the [records](../working-with-tables.md#records) of a table, resulting in a single string. Use this function to summarize the strings of a table, just as the **[Sum](function-aggregates.md)** function does for numbers.
2226

2327
[!INCLUDE [record-scope](../../../includes/record-scope.md)]
2428

25-
Use the **[Split](function-split.md)** function to split a string into a table of substrings.
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.
29+
Use the [**Split**](function-split.md) or [**MatchAll**](function-ismatch.md) function to split a string into a table of substrings.
2830

2931
## Syntax
32+
3033
**Concat**( *Table*, *Formula* )
3134

32-
* *Table* - Required. Table to operate on.
33-
* *Formula* - Required. Formula to apply across the records of the table.
35+
- *Table* - Required. Table to operate on.
36+
- *Formula* - Required. Formula to apply across the records of the table.
3437

3538
**Concatenate**( *String1* [, *String2*, ...] )
3639

37-
* *String(s)* - Required. Mix of individual strings or a single-column table of strings.
40+
- *String(s)* - Required. Mix of individual strings or a single-column table of strings.
3841

3942
## 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:
42-
43-
**Collect(Products, {String:"Violin", Wind:"Trombone", Percussion:"Bongos"}, {String:"Cello", Wind:"Trumpet", Percussion:"Tambourine"})**
44-
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.
60-
<br>**Concatenate(Employees.FirstName, " ", Employees.LastName)**
6143

44+
The examples in this section use these global variables:
45+
46+
- **FirstName** = "Jane"
47+
- **LastName** = "Doe"
48+
- **Products** = ![Table with two columns and four rows](media/function-concatenate/products.png)
49+
50+
To create these global variables in an app, insert a [**Button**](../controls/control-button.md) control, and set its **OnSelect** property to this formula:
51+
52+
```powerapps-dot
53+
Set( FirstName, "Jane" ); Set( LastName, "Doe" );
54+
Set( Products,
55+
Table(
56+
{ Name: "Violin", Type: "String" },
57+
{ Name: "Cello", Type: "String" },
58+
{ Name: "Trumpet", Type: "Wind" }
59+
)
60+
)
61+
```
62+
63+
Select the button (by clicking it while you hold down the Alt key).
64+
65+
### Concatenate function and the & operator
66+
67+
For these examples, set the **Text** property of a [**Label**](../controls/control-text-box.md) control to a formula from the first column of the next table.
68+
69+
| Formula | Description | Result |
70+
|---------|-------------|--------|
71+
| **Concatenate(&nbsp;LastName,&nbsp;",&nbsp;",&nbsp;FirstName&nbsp;)** | Concatenates the value in **LastName**, the string **", "** (a comma followed by a space), and the value in **FirstName**. | "Doe,&nbsp;Jane" |
72+
| **LastName&nbsp;&&nbsp;",&nbsp;"&nbsp;&&nbsp;FirstName** | Same as the previous example except using the **&** operator instead of the function. | "Doe,&nbsp;Jane" |
73+
| **Concatenate(&nbsp;FirstName,&nbsp;"&nbsp;",&nbsp;LastName&nbsp;)** | Concatenates the value in **FirstName**, the string **" "** (a single space), and the value in **LastName**. | "Jane&nbsp;Doe" |
74+
| **FirstName&nbsp;&&nbsp;"&nbsp;"&nbsp;&&nbsp;LastName** | Same as the previous example, using the **&** operator instead of the function. | "Jane&nbsp;Doe" |
75+
76+
### Concatenate with a single-column table
77+
78+
For this example, add a blank, vertical [**Gallery**](../controls/control-gallery.md) control, set its **Items** property to the formula in the next table, and then add a label in the gallery template.
79+
80+
| Formula | Description | Result |
81+
|---------|-------------|--------|
82+
| **Concatenate( "Name:&nbsp;",&nbsp;Products.Name, ",&nbsp;Type:&nbsp;",&nbsp;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. | ![Table of products](media/function-concatenate/single-column.png) |
83+
84+
### Concat function
85+
86+
For these examples, set the **Text** property of a label to a formula from the first column of the next table.
87+
88+
| Formula | Description | Result |
89+
|---------|-------------|--------|
90+
| **Concat( Products, Name & ", " )** | Evaluates the expression **Name & ", "** for each record of **Products** and concatenates the results together into a single text string. | "Violin,&nbsp;Cello,&nbsp;Trumpet,&nbsp;" |
91+
| **Concat( Filter(&nbsp;Products,&nbsp;Type&nbsp;=&nbsp;"String"&nbsp;), Name & ", " )** | Evaluates the formula **Name & ", "** for each record of **Products** that satisfies the filter **Type = "String"**, and concatenates the results into a single text string. | "Violin,&nbsp;Cello,&nbsp;" |
92+
93+
### Trimming the end
94+
95+
The last two examples include an extra ", " at the end of the result. The function appends a comma and a space to the **Name** value of every record in the table, including the last record.
96+
97+
In some cases, these extra characters don't matter. For example, a single-space separator doesn't appear if you show the result in a label. If you want to remove these extra characters, use the [**Left**](function-left-mid-right.md) or [**Match**](function-ismatch.md) function.
98+
99+
For these examples, set the **Text** property of a label to a formula from the first column of the next table.
100+
101+
| Formula | Description | Result |
102+
|---------|-------------|--------|
103+
| **Left( Concat(&nbsp;Products,&nbsp;Name&nbsp;&&nbsp;",&nbsp;"&nbsp;), Len(&nbsp;Concat(&nbsp;Products,&nbsp;Name&nbsp;&&nbsp;",&nbsp;"&nbsp;)&nbsp;)&nbsp;-&nbsp;2 )** | Returns the result of **Concat** but removes the last two characters, which form the extraneous separator. | "Violin,&nbsp;Cello,&nbsp;Trumpet" |
104+
| **Match( Concat(&nbsp;Products,&nbsp;Name&nbsp;&&nbsp;",&nbsp;"&nbsp;), "^(?&lt;trim&gt;.*),&nbsp;$" ).trim** | Returns the characters of **Concat** from the beginning of the text string (^) to the end ($) but doesn't include the unwanted comma and space at the end. | "Violin,&nbsp;Cello,&nbsp;Trumpet" |
105+
106+
### Split and MatchAll
107+
108+
If you used **Concat** with a separator, you can reverse the operation by combining the **Split** and **MatchAll** functions.
109+
110+
For these examples, add a blank, vertical gallery, set its **Items** property to a formula in the next table, and then add a label in the gallery template.
111+
112+
| Formula | Description | Result |
113+
|---------|-------------|--------|
114+
| **Split( Concat(&nbsp;Products,&nbsp;Name&nbsp;&&nbsp;",&nbsp;"&nbsp;), ", " )** | Splits the text string with the separator **", "**. The string ends with a comma and space, so the last row in the result is an empty string. | ![Table](media/function-concatenate/split.png) |
115+
| **MatchAll( Concat(&nbsp;Products,&nbsp;Name&nbsp;&&nbsp;",&nbsp;"&nbsp;), "[^\s,]+" ).FullMatch** | Splits the text string based on characters that aren't spaces or commas. This formula removes the extra comma and space at the end of the string. | ![Table](media/function-concatenate/matchall.png)

0 commit comments

Comments
 (0)