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.

View solution in original post

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,094)