cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bu
Regular Visitor

Concurrent error - invalid arguments

I am trying to cut down my 10+ second startup time every time I open this app by adding a Concurrent function to my OnStart, but I can't get past this error and have only found the documentation here and it's not any help. 

 

Set(PassedCustomer, Param("customer"));

Concurrent(
ClearCollect(Employee, First(Office365Users.SearchUser({searchTerm: PassedCustomer}))),
ClearCollect(Manager, Office365Users.Manager(First(Employee).Id))
);

I only have these two lines in there right now, but I get "The function 'Concurrent' has some invalid arguments".

 

And if any one has any other suggestions on how to speed up an app embedded in Dynamics 365 page it would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
CarlosFigueira
Power Apps
Power Apps

The result of the first expression in the Concurrent function is used in the second one, so you cannot use them concurrently:

Concurrent(
    ClearCollect(Employee, First(Office365Users.SearchUser({searchTerm: PassedCustomer}))),
    ClearCollect(Manager, Office365Users.Manager(First(Employee).Id))
);

When creating the Manager collection, it uses the first element of the Employee collection - so it first needs to wait until the first expression is complete (to populate the Employee collection) before it can take the first element of it. That's why those expressions cannot be run concurrently.

View solution in original post

1 REPLY 1
CarlosFigueira
Power Apps
Power Apps

The result of the first expression in the Concurrent function is used in the second one, so you cannot use them concurrently:

Concurrent(
    ClearCollect(Employee, First(Office365Users.SearchUser({searchTerm: PassedCustomer}))),
    ClearCollect(Manager, Office365Users.Manager(First(Employee).Id))
);

When creating the Manager collection, it uses the first element of the Employee collection - so it first needs to wait until the first expression is complete (to populate the Employee collection) before it can take the first element of it. That's why those expressions cannot be run concurrently.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,460)