cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ndy856
Regular Visitor

Using ; to ensure 1st Fx work before 2nd Fx

For a button Example for OnSelect Fx using a semicolon:

Office365.sendemail(blah blah) ;  UpdateCotext(color blah)

Does this mean when pressed the Email would be sent successfully soon as I see the button change color? For end user, will the UpdateContext still work when there's error occurs in the back end in SendEmail?

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Thorpe
Super User
Super User

Yes the UpdateContext will still execute. If you only want to execute the UpdateContext() if the email was sent then you could do something like this:

 

Set(varIsMailSent, Office365Outlook.SendEmailV2(.........));
If(varIsMailSent, UpdateContext(......))

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

5 REPLIES 5
Jeff_Thorpe
Super User
Super User

It will process in order from left to right. So the SendEmail() will happen and the UpdateContext().



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
ndy856
Regular Visitor

thanks, and if any error occurs in SendEmail, will the UpdateContext will still work?

Jeff_Thorpe
Super User
Super User

Yes the UpdateContext will still execute. If you only want to execute the UpdateContext() if the email was sent then you could do something like this:

 

Set(varIsMailSent, Office365Outlook.SendEmailV2(.........));
If(varIsMailSent, UpdateContext(......))

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

perfect. yes, I want to assure users that the email were sent successfuly first then the button will change color to their view.  hope it won't create much delays with they IF statement. 

Jeff_Thorpe
Super User
Super User

@ndy856 , you won't see much of a delay if any.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (5,301)