cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
miguelrodrigue Helper III
Helper III

do powerapps' functions run in parallel?

So, say I have multiple if statements within and OnSelect property on a button and run it will they run parallel or will one execute then the other? Ex:

 

Set(Id,MainForm.LastSubmit.ID);
If
(
"Materials Inspection" in Screens,
SubmitForm(MatInspecForm)
);
If
(
"Abandonment of Pipelines" in Screens,
SubmitForm(Form3)
);

 

 

I'm using the Id variable to as a reference in the other forms' foreign key data field. Sometimes it gets the data key, sometimes it doesn't. So, my best guess as to what is happening is that they are running in parallel and the forms get submitted before the foreign key is set.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: do powerapps' functions run in parallel?

@miguelrodrigue 

When using the SUBMITFORM function PowerApps will send the information to the datasource and then immediately move to the next step.  It does not wait for any response to say the action way completed.  Therefore, its not really running in parallel but I understand what you are saying.  

 

The solution is to move this code into the OnSuccess property of MainForm.  That way it will only execute once PowerApps receives a response from the datasource that the record was successfully inserted.

 

Set(Id,MainForm.LastSubmit.ID);
If
(
"Materials Inspection" in Screens,
SubmitForm(MatInspecForm)
);
If
(
"Abandonment of Pipelines" in Screens,
SubmitForm(Form3)
);

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: do powerapps' functions run in parallel?

@miguelrodrigue 

When using the SUBMITFORM function PowerApps will send the information to the datasource and then immediately move to the next step.  It does not wait for any response to say the action way completed.  Therefore, its not really running in parallel but I understand what you are saying.  

 

The solution is to move this code into the OnSuccess property of MainForm.  That way it will only execute once PowerApps receives a response from the datasource that the record was successfully inserted.

 

Set(Id,MainForm.LastSubmit.ID);
If
(
"Materials Inspection" in Screens,
SubmitForm(MatInspecForm)
);
If
(
"Abandonment of Pipelines" in Screens,
SubmitForm(Form3)
);

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

miguelrodrigue Helper III
Helper III

Re: do powerapps' functions run in parallel?

@mdevaney 
you guys are just the best. My life would just be suffering constantly if this forum didn't exist

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (2,337)