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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (67,992)