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/connections/connection-common-data-service.md
+14-3Lines changed: 14 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -19,11 +19,22 @@ search.app:
19
19
20
20
You can securely store your business data in Common Data Service and build rich apps in PowerApps so that users can manage that data. You can also integrate that data into solutions that include Microsoft Flow, Power BI, and data from Dynamics 365.
21
21
22
-
By default, the Common Data Service connector connects to data in your app's current environmnent. If your app moves to another environment, the connector connects to data in the new environment. This works well for an app using a single environment or an app that follows an ALM process for moving from Development to Test to Production.
22
+
By default, the Common Data Service connector connects to data in your app's current environmnent. If your app moves to another environment, the connector connects to data in the new environment. This behavior works well for an app using a single environment or an app that follows an ALM process for moving from Development to Test to Production.
23
23
24
-
When you add a data source with the Common Data Service connector, you can change the environment and then select one or more entities. By default, the app connects to data in the current environment, and the UI shows **(Current)** over the list of entities. If you select **Change**, you can specify a different environment to pull data from it instead of or in addition to the current environment.
24
+
When you add a data source with the Common Data Service connector, you can change the environment and then select one or more entities. By default, the app connects to data in the current environment, and the UI shows **(Current)** over the list of entities.
25
25
26
-

Copy file name to clipboardExpand all lines: powerapps-docs/maker/canvas-apps/functions/function-astype-istype.md
+16-14Lines changed: 16 additions & 14 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: 05/06/2019
10
+
ms.date: 05/17/2019
11
11
ms.author: gregli
12
12
search.audienceType:
13
13
- maker
@@ -17,27 +17,29 @@ search.app:
17
17
18
18
# AsType and IsType functions in canvas apps
19
19
20
-
Checks a record reference for a specific entity type and treats the reference as a specific type.
20
+
Checks a record reference for a specific entity type (**IsType**) and treats the reference as a specific type (**AsType**).
21
21
22
22
## Description
23
23
24
-
Read [understand record references and polymorphic lookups](../working-with-references.md) for a broader introduction and more details.
24
+
Read [Understand record references and polymorphic lookups](../working-with-references.md) for a broader introduction and more details.
25
25
26
26
A lookup field usually refers to records in a particular entity. Because the entity type is well established, you can access the fields of the lookup by using a simple dot notation. For example, **First( Accounts ).'Primary Contact'.'Full Name'** walks from the **Accounts** entity to the **Primary Contact** record in the **Contacts** entity and extracts the **Full Name** field.
27
27
28
-
Common Data Service also supports polymorphic lookup fields, which can refer to records from a set of entities, as in these examples:
28
+
Common Data Service also supports polymorphic lookup fields, which can refer to records from a set of entities, as in these examples.
29
29
30
30
| Lookup field | Can refer to |
31
31
|--------------|--------------|
32
32
|**Owner**|**Users** or **Teams**|
33
33
|**Customer**|**Accounts** or **Contacts**|
34
34
|**Regarding**|**Accounts**, **Contacts**, **Knowledge Articles**, etc. |
35
35
36
+
<!--note from editor: Change "Knowledge Articles" to "Knowledge Base articles" if that is what is being referenced. -->
37
+
36
38
In canvas-app formulas, you can use record references to work with polymorphic lookups. Because a record reference can refer to different entities, you don't know which fields will be available when you write a formula. The *.Field* notation isn't available. Those formulas must adapt to the records that the app encounters when it runs.
37
39
38
-
The **IsType** function tests whether a record reference refers to a specific entity type. The function returns a Boolean *true* or *false*.
40
+
The **IsType** function tests whether a record reference refers to a specific entity type. The function returns a Boolean TRUE or FALSE.
39
41
40
-
The **AsType** function treats a record reference as a specific entity type, sometimes referred to as *casting*. You can use the result as if it were a record of the entity and, again, use *.Field* notation to access all of the fields of that record. An error occurs if the reference isn't of the specific type.
42
+
The **AsType** function treats a record reference as a specific entity type, sometimes referred to as *casting*. You can use the result as if it were a record of the entity and, again, use the *.Field* notation to access all of the fields of that record. An error occurs if the reference isn't of the specific type.
41
43
42
44
Use these functions together to first test the entity type of a record and then treat it as a record of that type so that the fields are available:
43
45
@@ -60,7 +62,7 @@ Similarly, you can use record references with the [**Patch**](function-patch.md)
If used in a record context, such as within a [**Gallery**](../controls/control-gallery.md) or [**Edit form**](../controls/control-form-detail.md) control, you might need to use the [global disambiguation operator](operators.md#disambiguation-operator) to reference the entity type. For example, this formula would be effective for a gallery that's displaying a list of contacts where **Company Name** is a **Customer** lookup.
65
+
If used in a record context, such as within a [**Gallery**](../controls/control-gallery.md) or [**Edit form**](../controls/control-form-detail.md) control, you might need to use the [global disambiguation operator](operators.md#disambiguation-operator) to reference the entity type. For example, this formula would be effective for a gallery that's displaying a list of contacts where **Company Name** is a **Customer** lookup:
For both functions, you specify the type through the name of the data source that's connected to the entity. For the formula to work, you must also add a data source to the app for any types that you want to test or cast. For example, you must add the **Users** entity as a data source if you want to use **IsType** and **AsType** with an **Owner** lookup and records from that entity. You can add only the data sources that you actually use in your app; you don't need to add all the entities that a lookup could reference.
73
75
74
-
If the record reference is *blank*, **IsType** returns *false*, and **AsType** returns *blank*. All fields of a *blank* record will be *blank*.
76
+
If the record reference is *blank*, **IsType** returns FALSE, and **AsType** returns *blank*. All fields of a *blank* record will be *blank*.
75
77
76
78
## Syntax
77
79
@@ -83,7 +85,7 @@ If the record reference is *blank*, **IsType** returns *false*, and **AsType** r
83
85
**IsType**( *RecordReference*, *EntityType* )
84
86
85
87
-*RecordReference* - Required. A record reference, often a lookup field that can refer to a record in any of multiple entities.
86
-
-*EntityType* - Required. The specific entity to which to cast.
88
+
-*EntityType* - Required. The specific entity to which the record should be cast.
87
89
88
90
## Example
89
91
@@ -95,12 +97,12 @@ If the record reference is *blank*, **IsType** returns *false*, and **AsType** r
95
97
> [!div class="mx-imgBorder"]
96
98
> 
97
99
98
-
1. Insert a **Gallery** control with a **Blank vertical** orientation:
100
+
1. Insert a **Gallery** control with a **Blank vertical** orientation.
99
101
100
102
> [!div class="mx-imgBorder"]
101
103
> 
102
104
103
-
1. On the **Properties** tab of the right-hand pane, set the gallery's **Items** property to **Contacts**.
105
+
1. On the **Properties** tab near the right side of the screen, set the gallery's **Items** property to **Contacts**.
104
106
105
107
> [!div class="mx-imgBorder"]
106
108
> 
@@ -113,12 +115,12 @@ If the record reference is *blank*, **IsType** returns *false*, and **AsType** r
113
115
> [!div class="mx-imgBorder"]
114
116
> 
115
117
116
-
1. In the **Data** pane, open the **Title1** list, and then select **Full Name**:
118
+
1. In the **Data** pane, open the **Title1** list, and then select **Full Name**.
117
119
118
120
> [!div class="mx-imgBorder"]
119
121
> 
0 commit comments