Skip to content

Commit f162e71

Browse files
authored
Merge pull request #10253 from MicrosoftDocs/guidance-guidelines-fixes
Fix broken & missing code
2 parents cff6542 + 09899a2 commit f162e71

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

powerapps-docs/guidance/coding-guidelines/code-optimization.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
---
22
title: Power Apps code optimization
33
description: Learn about how to optimize code in Power Apps.
4-
ms.date: 06/12/2024
4+
ms.date: 06/25/2024
55
ms.topic: conceptual
66
ms.subservice: guidance
77
ms.service: powerapps
88
author: robstand
99
ms.author: rachaudh
10-
1110
---
1211

13-
# Code Optimization
12+
# Code optimization
1413

1514
As canvas apps evolve to meet diverse business requirements, the challenge of maintaining optimal performance becomes a critical consideration. The intricacies of data handling, user interface design, and functionality within canvas apps necessitate a nuanced approach to code optimization.
1615

@@ -26,9 +25,16 @@ The `With` function evaluates a formula for a single record. The formula can cal
2625

2726
### Concurrent function
2827

29-
The `Concurrent` function allows multiple formulas specified within the same property to be evaluated at the same time if they have connector or Dataverse calls. Normally, multiple formulas are evaluated by chaining them together with the `;` (semi-colon) operator, which evaluates each formula sequentially. With the `Concurrent` function, the app will evaluate all formulas within a property concurrently even after using the `;` operator. This concurrency helps users wait less for the same result. When data calls don't start until the previous calls finish, the app must wait for the sum of all request times. If data calls start at the same time, the app needs to wait only for the longest request time. [Learn more](/power-platform/power-fx/reference/function-concurrent) about the `Concurrent` function
28+
The `Concurrent` function allows multiple formulas specified within the same property to be evaluated at the same time if they have connector or Dataverse calls. Normally, multiple formulas are evaluated by chaining them together with the `;` (semi-colon) operator, which evaluates each formula sequentially. With the `Concurrent` function, the app will evaluate all formulas within a property concurrently even after using the `;` operator. This concurrency helps users wait less for the same result. When data calls don't start until the previous calls finish, the app must wait for the sum of all request times. If data calls start at the same time, the app needs to wait only for the longest request time. [Learn more](/power-platform/power-fx/reference/function-concurrent) about the `Concurrent` function.
3029

31-
![A screenshot of a Power Fx formula that uses the Concurrent function](media/image14.png)
30+
```powerappsfl
31+
Concurrent(
32+
ClearCollect(colAccounts1, Accounts),
33+
ClearCollect(colUsers1, Users),
34+
ClearCollect(colEnvDef1, 'Environment Variable Definitions'),
35+
ClearCollect(colEnvVal1, 'Environment Variable Values')
36+
);
37+
```
3238

3339
### Coalesce Function
3440

@@ -193,7 +199,11 @@ The code works as so:
193199

194200
- `Formula` is the output of the function
195201

196-
![A screenshot of the Power Fx window with a user-defined function in the fx box](media/image17.png)
202+
```powerappsfl
203+
// Function to calculate the area of a circle based on the radius
204+
calcAreaOfCircle(radius: Number): Number =
205+
IfError(Pi() * radius * radius, 0);
206+
```
197207

198208
Use `IfError` to implement error handling within the defined function.
199209

0 commit comments

Comments
 (0)