things happening concurrently in Power Apps

The sense and nonsense of the Concurrent function in Power Apps

Recently I have found many Power Apps solutions that use the Concurrent function all the time. The idea that the Concurrent function will always make things run faster is not right. Sometimes however it does make sense to use the concurrent function.

When should you use Concurrent function?

Obvious nonsense of the concurrent function

You should probably start by checking the app checker as it will report some potential issues.

Check the app Checker reporting Concurrent function errors

When you run a Navigate in your Concurrent function  ( yes I have seen that happen!).. you will get the Use of functions that can change the screen or exit the app within the Concurrent function are not allowed warning.

Ok, that should be obvious.

Not so obvious nonsense of the concurrent function

Then there can be complexities introduced by the Concurrent function. If you set for example many variables then there is no need to use the concurrent function. I tried setting more than 1000 variables. This doesn’t take any time at all. Therefore why would you add a Concurrent function. Remember less code is better!

The sense of the concurrent function

When you do multiple data updates or when you read multiple data sources you could gain a lot of speed using the Concurrent function. If you run multiple Patch updates like the one shown below then it could make sense to use the concurrent function.

Patch(
        '[dbo].[MyDataSource]',
        {FieldID: Fields.Selected.ID},
        {
            Flag: 1,
            Comment: ChangeComment.Text,
        }
    );

You should however be careful. If you want to have control over the order of the updates then you might not want to use concurrent.

Another good reason to use concurrent is when you read data form multiple data sources.You could easily reduce the run time to about 50% of the original time. Especially when you develop solutions where performance is everything you might as well look at performance improvements in Power Apps.

Other Performance related posts

1 Flow Performance tip to get your flows out of the stone age

Improve your flow’s performance in a few easy steps

How to make your flows perform better

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: