Skip to content

Commit 68baaa7

Browse files
committed
updates to power-fx
1 parent 209e6dc commit 68baaa7

File tree

4 files changed

+36
-36
lines changed

4 files changed

+36
-36
lines changed

powerapps-docs/maker/data-platform/low-code-plug-ins.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,14 @@ For a few examples of how to create a low-code plug-in, go to [Example Dataverse
278278
- Nested support. Plug-ins can only call first-party actions published by Microsoft from Power Fx expressions.
279279
- Some `Collect` scenarios require `Patch`. There are some scenarios where `Collect()` doesn't work. The workaround is to use `Patch()` as shown in the populating regarding column example below. If you're creating an automated plug-in, prepend @ to each table referenced in the Power Fx formula.
280280

281-
```powerapps-dot
281+
```power-fx
282282
Patch(Faxes,
283283
Collect(Faxes, { Subject : "Sub1" } ),
284284
{ Regarding : First(Accounts) }
285285
)
286286
```
287287
- When low-code plug-ins interact with connectors and DLP is employed, the admin can block creation of connections using DLP. However, existing connection references in the Dataverse environment continue to function. In case the admin needs to block all low-code plug-in interactions with any connectors, they can disable the organization setting `Allowconnectorsonpowerfxactions`. This setting is enabled by default and can be disabled by usual SDK methods (WebAPI, SDK, PowerShell, and so on). You can disable this using a low-code instant plug-in as follows:
288-
```powerapps-dot
288+
```power-fx
289289
Patch(Organizations, First(Organizations), { 'Enable connectors on power fx actions.': 'Enable connectors on power fx actions. (Organizations)'.No })
290290
```
291291
- Plug-ins that use connectors can only output results from specific fields. Due to this, you need to map specific primitive values from the connector response to output values.

powerapps-docs/maker/data-platform/lowcode-plug-ins-examples.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ This example uses the [Abs() function](/power-platform/power-fx/reference/functi
3434
1. Create an `Out` parameter to validate expected behavior that makes sense, such as a string Optionally use input parameters to make testing easier, that makes sense with the formula.
3535
1. In the formula editor, wrap the `Out` parameter in curly brackets:
3636

37-
```powerapps-dot
37+
```power-fx
3838
{Out: "" }
3939
```
4040

4141
1. Enter an expression that tests the formula:
4242
- Validate that intellisense accepts the formula (text turns light blue).
4343
- Implement an expression that provides an output to help validate the result, for example.
4444

45-
```powerapps-dot
45+
```power-fx
4646
{Out: "Abs(-5) = 5: " & Text( Abs(-5) = 5 )  }
4747
```
4848

@@ -60,7 +60,7 @@ Implement server-side input validation, such as duplicate error detection that t
6060
1. For **Table**, select **Contact**.
6161
1. For **Run this plugin when the row is**, select **Created**.
6262
1. In the **Formula** box, enter this formula:
63-
```powerapps-dot
63+
```power-fx
6464
If( !IsBlank(LookUp([@Contacts],'Last Name'=ThisRecord.'Last Name' && 'First Name'=ThisRecord.'First Name')),
6565
Error("You have existing contacts with the same first name and last name")
6666
)
@@ -88,7 +88,7 @@ Display specific types of errors using the _ErrorKind_ enumeration.
8888
- **Run this plugin when the row is**: **Updated**
8989
1. Enter the formula below:
9090

91-
```powerapps-dot
91+
```power-fx
9292
If(ThisRecord.'Due Date' < Now(),
9393
Error({ Kind: ErrorKind.Validation , Message: "The due date cannot be in the past" })
9494
);
@@ -136,7 +136,7 @@ Here's an email template example that you can create for the SenMail based data
136136
- **Run this plugin with the row is**: **Created**
137137
- **Formula**: Paste the code below into the **Formula** box. For more information abut the SendEmailFromTemplate function, to [SendEmailFromTemplate Action](/power-apps/developer/data-platform/webapi/reference/sendemailfromtemplate?view=dataverse-latest&preserve-view=true ).
138138

139-
```powerapps-dot
139+
```power-fx
140140
XSendEmailFromTemplate(
141141
LookUp('Email Templates',StartsWith(title,"Order Thank You")).'Email Template',
142142
ThisRecord,
@@ -162,7 +162,7 @@ In-app notifications enable makers to configure contextual, actionable notificat
162162
- **OrderID**: **String**
163163
- **TechnicianEmail**: **String**
164164
1. **Formula**. Paste the following code in the **Formula** box. For more information about this function, go to [SendAppNotification Action](/power-apps/developer/data-platform/webapi/reference/sendappnotification?view=dataverse-latest&preserve-view=true ).
165-
```powerapps-dot
165+
```power-fx
166166
XSendAppNotification(
167167
"New service",
168168
LookUp(Users,'Primary Email'=TechnicianEmail),
@@ -187,7 +187,7 @@ In-app notifications enable makers to configure contextual, actionable notificat
187187
1. Select screen on the left navigation pane, or create a new one.
188188
1. On the **Insert** menu, add a **Button** to the page using the **Text** *Notify technician*.
189189
1. Select the button, and enter the following in the **fx** formula bar, where *DataCardValue17* is the column that contains the Order ID, and *DataCardValue15* is the column that contains the technician’s email address. In this example, a canvas app named **Service Order App** is used.
190-
```powerapps-dot
190+
```power-fx
191191
Environment.cr8b8_Notifytechnician1({
192192
OrderID: DataCardValue17.Text,
193193
TechnicianEmail: DataCardValue15.Text
@@ -227,7 +227,7 @@ Prerequisites:
227227
> Use the [With()](/power-platform/power-fx/reference/function-with) function to capture the entire response from one action if you want to access different properties the response might have. In the example below, there's an input parameter `Location` (string) and an output parameter `Out` (string).
228228
>
229229
230-
```powerapps-dot
230+
```power-fx
231231
With({ /* Capture current weather response from connector */
232232
c: new_MsnWeather.CurrentWeather( Location, "Imperial" ).responses.weather.current
233233
},{ /* Return concatenated weather details */

powerapps-docs/maker/model-driven-apps/commanding-use-powerfx.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ To define visibility logic, select the command. Then select **Visibility** on th
5858

5959
### Patch (update) the current selected record
6060

61-
```powerapps-dot
61+
```power-fx
6262
Patch(Accounts, Self.Selected.Item, {'Account Name': "Changed Account name"})
6363
```
6464

@@ -67,25 +67,25 @@ Patch(Accounts, Self.Selected.Item, {'Account Name': "Changed Account name"})
6767
> [!NOTE]
6868
> If the related table is not already in the command component library you'll need to open it in canvas studio and add the data source there.
6969
70-
```powerapps-dot
70+
```power-fx
7171
Patch(Tasks,Defaults(Tasks),{Regarding:Self.Selected.Item},{Subject:"Subject of the Task"})
7272
```
7373

7474
### Check and edit a date property
7575

76-
```powerapps-dot
76+
```power-fx
7777
If(Self.Selected.Item.'Last Date Included in Campaign'>DateAdd(Now(),-3), Patch(Accounts,Self.Selected.Item,{'Last Date Included in Campaign':Date(2021,10,19)}))
7878
```
7979

8080
### Visible property: Only show the command if one or more records is selected in a grid view
8181

82-
```powerapps-dot
82+
```power-fx
8383
CountRows(Self.Selected.AllItems) > 0
8484
```
8585

8686
### Control visibility based on record data
8787

88-
```powerapps-dot
88+
```power-fx
8989
//Button will be visible for accounts with Account Rating > 20
9090
Self.Selected.Item.'Account Rating'>20
9191
```
@@ -99,39 +99,39 @@ Self.Selected.Item.'Account Rating'>20
9999

100100
To navigate to a custom canvas page within a model-driven app, pass the page name as the first argument.
101101

102-
```powerapps-dot
102+
```power-fx
103103
Navigate( myCustomPage )
104104
```
105105

106106
### Navigate to the default view of the table
107107

108108
To navigate to the default view of the table, pass the table name as the first argument.
109109

110-
```powerapps-dot
110+
```power-fx
111111
Navigate( Accounts )
112112
```
113113

114114
### Navigate to specific system view of the table
115115

116116
To navigate to a specific system view of the table, pass the table's `Views` enum.
117117

118-
```powerapps-dot
118+
```power-fx
119119
Navigate( 'Accounts (Views)'.'My Active Accounts' )
120120
```
121121

122122
### Navigate to the default form of the table
123123

124124
To navigate to the default form of the table, pass the record as the first argument.
125125

126-
```powerapps-dot
126+
```power-fx
127127
Navigate( Gallery1.Selected )
128128
```
129129

130130
### Navigate to the default form of the table in create mode
131131

132132
To navigate to the default form of the table, pass a Dataverse record created from the [Defaults](../canvas-apps/functions/function-defaults.md) function. This opens the default form with the record as a new record. The **Defaults** function takes the table name to create the record.
133133

134-
```powerapps-dot
134+
```power-fx
135135
Navigate( Defaults( Accounts ) )
136136
```
137137

@@ -141,14 +141,14 @@ Use the [**DataSourceInfo** function](/power-platform/power-fx/reference/functio
141141

142142
For example, use **RecordInfo** to determine if the current user has permission to modify a record and appropriately show or hide an "Edit" button using its **Visible** property:
143143

144-
```powerapps-dot
144+
```power-fx
145145
EditButton.Visible =
146146
RecordInfo( Gallery1.Selected, RecordInfo.EditPermission )
147147
```
148148

149149
For example, use **DataSourceInfo** to determine if the current user has permission to create a record and appropriately show or hide a "Create" button using its **Visible** property:
150150

151-
```powerapps-dot
151+
```power-fx
152152
CreateButton.Visible =
153153
DataSourceInfo( Accounts, DataSourceInfo.CreatePermission )
154154
```
@@ -157,7 +157,7 @@ CreateButton.Visible =
157157

158158
Use the [**Confirm** function](/power-platform/power-fx/reference/function-confirm) to display a dialog box on top of the current screen.
159159

160-
```powerapps-dot
160+
```power-fx
161161
Notify( Confirm( "Are you sure?",
162162
{ ConfirmButton: "Yes", CancelButton: "No" }
163163
)
@@ -174,7 +174,7 @@ A notification can be shown to app users by calling the [Notify function](../can
174174
> [!NOTE]
175175
> `NotificationType.Success` is not currently supported and will result in an informational notification type.
176176
177-
```powerapps-dot
177+
```power-fx
178178
Notify( "Model-driven app notification message" )
179179
```
180180

powerapps-docs/maker/model-driven-apps/page-powerfx-in-model-app.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ This article outlines how the common [Microsoft Power Fx](../canvas-apps/formula
2222

2323
A notification can be shown to the user in a custom page by calling the [Notify function](../canvas-apps/functions/function-showerror.md). When the notification messages appear, they're docked above the default page to stay visible until disabled. If a timeout interval is provided, the notification message will disappear after the timeout interval. It is recommended not to use a timeout interval of 10, as this is no longer considered as a timeout interval. More information: [Notify function](../canvas-apps/functions/function-showerror.md).
2424

25-
```powerapps-dot
25+
```power-fx
2626
Notify( "Custom page notification message" )
2727
```
2828

2929
> [!div class="mx-imgBorder"]
3030
> ![Custom page notify information message bar](media/page-powerfx-in-model-app/custom-page-notify-information.png "Custom page notify information message bar")
3131
32-
```powerapps-dot
32+
```power-fx
3333
Notify( "Custom page notify warning message", NotificationType.Warning )
3434
```
3535

@@ -48,15 +48,15 @@ The [Navigate function](../canvas-apps/functions/function-navigate.md) allows th
4848

4949
To navigate from one custom page to another, pass the display name of the custom page as the first parameter.
5050

51-
```powerapps-dot
51+
```power-fx
5252
Navigate( CustomPage2 )
5353
```
5454

5555
### Navigate to the default view of the table
5656

5757
To navigate to the default view of the table, pass table name as the first parameter.
5858

59-
```powerapps-dot
59+
```power-fx
6060
Navigate( Accounts )
6161
```
6262

@@ -67,23 +67,23 @@ Navigate( Accounts )
6767

6868
To navigate to a specific system view of the table, pass the GUID of the view.
6969

70-
```powerapps-dot
70+
```power-fx
7171
Navigate( 'Accounts (Views)'.'My Active Accounts' )
7272
```
7373

7474
### Navigate to the default form of the table
7575

7676
To navigate to the default form of the table, pass the record as the first parameter.
7777

78-
```powerapps-dot
78+
```power-fx
7979
Navigate( Gallery1.Selected )
8080
```
8181

8282
### Navigate to a specific form of a table
8383

8484
To pass a Dataverse record to a specific form, pass the form name in the second parameter's Page attribute.
8585

86-
```powerapps-dot
86+
```power-fx
8787
Navigate(
8888
AccountGallery.Selected,
8989
{ Page: 'Accounts (Forms)'.Account } )
@@ -93,7 +93,7 @@ Navigate(
9393

9494
To pass a Dataverse record to a specific custom page, pass the custom page name in the second parameter's Page attribute.
9595

96-
```powerapps-dot
96+
```power-fx
9797
Navigate(
9898
AccountGallery.Selected,
9999
{ Page: 'Account Record Page' } )
@@ -103,7 +103,7 @@ In the target custom page, the record is retrieved using **Param** function to g
103103

104104
Below is an example of loading the record into an **EditForm** control.
105105

106-
```powerapps-dot
106+
```power-fx
107107
AccountEditForm.DataSource = Accounts
108108
AccountEditForm.Item =
109109
LookUp( Accounts, accountid = GUID( Param("id") ) )
@@ -113,15 +113,15 @@ AccountEditForm.Item =
113113

114114
To navigate to the default form of the table in create mode, pass a Dataverse record created from the [Defaults](../canvas-apps/functions/function-defaults.md) function. This opens the default form with the record as a new record. The **Defaults** function takes the table name to create the record.
115115

116-
```powerapps-dot
116+
```power-fx
117117
Navigate( Defaults( Accounts ) )
118118
```
119119

120120
### Navigate to the default form of the table in create mode with field defaulted
121121

122122
To navigate to a new record with some fields defaulted, use **Patch** function to set fields on the default record for the table.
123123

124-
```powerapps-dot
124+
```power-fx
125125
Navigate(
126126
Patch(
127127
Defaults(Accounts), { 'Account Name': "My company", Phone: "555-3423" } )
@@ -132,7 +132,7 @@ Navigate(
132132

133133
To navigate back to the last page or to close a dialog, the [Back](../canvas-apps/functions/function-navigate.md) function is called in a custom page. The **Back** function closes the current page and returns to the last model-driven app or custom page in the model-driven app. If the custom page has multiple screens, see the article [Navigating back when custom page has multiple screens](#navigating-back-when-custom-page-has-multiple-screens).
134134

135-
```powerapps-dot
135+
```power-fx
136136
Back()
137137
```
138138

0 commit comments

Comments
 (0)