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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,758)