cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MattiaD
Frequent Visitor

OnSelect function how to run the function in order of how it is written

When the button is clicked it should submit the form and once the form has been submitted it should popup and then start the run and wait for the result to change screens. At the moment it sends the form but immediately changes the screen without waiting for Power Automate's response on which screen it should change, this is the code I have inserted:

 

SubmitForm(Form2_1) & UpdateContext({Caricamento:true}) & If(livello1.Run(DataCardValue6_1).liv01 = "Complimenti1"; Navigate(Complimenti_1); Navigate('Non superato_1'))

 

Thank you very much in advance

3 ACCEPTED SOLUTIONS

Accepted Solutions
shoog
Dual Super User
Dual Super User

It would be best to move all functions except the submitform to the OnSuccess property of your form.

This way the remaining functions only get executed after the form submit was succesful.

You can optionally use the OnFailure property of the form in case the form submit has failed.

View solution in original post

shoog
Dual Super User
Dual Super User

Try changing the DataCardValue6_1 to Form.LastSubmit.<field name>

where <field name> contains the database field you refer to in that datacard.

View solution in original post

MattiaD
Frequent Visitor

@shoog OK, now it worked I had to put the UpdateContext function together with SubmitForm otherwise it would run before the popup.


Thank you very much

View solution in original post

4 REPLIES 4
shoog
Dual Super User
Dual Super User

It would be best to move all functions except the submitform to the OnSuccess property of your form.

This way the remaining functions only get executed after the form submit was succesful.

You can optionally use the OnFailure property of the form in case the form submit has failed.

MattiaD
Frequent Visitor

@shoog I have moved the two functions to OnSucces, but I still have the problem that it does not wait for the data to come back from the flow but changes the screen immediately (sets the screen as a false value).

shoog
Dual Super User
Dual Super User

Try changing the DataCardValue6_1 to Form.LastSubmit.<field name>

where <field name> contains the database field you refer to in that datacard.

MattiaD
Frequent Visitor

@shoog OK, now it worked I had to put the UpdateContext function together with SubmitForm otherwise it would run before the popup.


Thank you very much

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,546)