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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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