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.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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