
Announcements
Hi All,
We have 3 flows to call from the Power app (APP-Onstart) which is loading/taking more time, hence i would like use Concurrent function to run the flows parallelly.
3 flows
1. get basic user details
2. Get user license details
3. Get groups where the user member of
so running/calling 3 flows is meanless, hence we would like to check if 1. Get user flow returns(user details means a single row)
then run the next 2 flows in concurrent function, if 1 flow response is blank then skip the remaining 2 flows.
because if user details are not found in the azure ad then there is no use to call reaming 2 flows as well.
As of now
Set(userEmail, User().Email);
Concurrent(
ClearCollect(UserCollection,GetUser.Run(userEmail)),
ClearCollect(UserLicenses, GetLicense.Run(userEmail)),
ClearCollect(UserGroups,GetGroups.Run(userEmail))
);
Any suggestions here to check the 1 flow response (has user details row) if the row exists or the collection is not empty or null, then call the next two flows.
I did like this, but is this the best practice ..?
ClearCollect(UserCollection,GetUsers.Run(userEmail));
If(CountRows(UserCollection)>0,
Concurrent(ClearCollect(UserLicenses, GetLicese.Run(userEmail)),
ClearCollect(UserGroups,GetGroups.Run(userEmail))));Thanks,
Murali
Hi muralikrishna12 ,
I think you can use the WITH function can help in this situation
With the code below, the GetUsers will run and gather result before the if statement execute
With({ UserCollection: GetUsers.Run(userEmail)},
If(CountRows(UserCollection) > 0,
Concurrent(
ClearCollect(UserLicenses,GetLicese.Run(userEmail)),
ClearCollect(UserGroups,GetGroups.Run(userEmail))
))
)
Best regards