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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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