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

Duplicate email sends when updating

Hello,

 

I have a Power Apps that is connected to a sharepoint list.

 

It has fields that looks like this:

 

Status:  New / In progress / Closed

Price: $X.XX

Qty: 1

 

When I change the status from "New" to "In Progress", I have set up an automatic email to fire that the status is in progress through Power Automate. 

 

However, when I change the other fields like the price, the same email fires again and I want to avoid it, any suggestions on how to do this? Not sure if I have to post this here or in Power Automate discussion board.

 

Thank you for your help in advance.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @julleus21 ,

 

This has to be handled at 3 places, I in SharePoint, PowerApp, and Flow. please follow as below:

  1. onStart property of the App set as below

 

UpdateContext({varUpdateStatusFlag:false})

 

  • Add a new row in the SharePoint as StatusUpdateFlag as Yes/No field
  • Write the below formula OnChange of the status dropdown

 

If(DataCardValue103.Selected.Value <> LookUp(SampleList,ID=4,Status).Value, UpdateContext({varUpdateStatusFlag:true}),UpdateContext({varUpdateStatusFlag:false}))

 

  • on the edit form of the list, item set the status default value as 

 

varUpdateStatusFlag​

 

  • At the time of submitting it will update the updated flag also back to SharePoint list.
  • Now in the flow check this status flag also if it is true and "In-Progress" then send the email if not no email.
  • once you send the email reset the status flag to NO/False

See the working model below to update the list value:
resetting Flag.gif

I am more than happy to share this solution if you see that helps you.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

6 REPLIES 6
Super User II
Super User II

hi @julleus21 ,

 

This is expected because you might be checking only the status on the details screen is In-Progress or not.

How are you updating the status? I mean are you updating as part of the details view when you select an item from Gallery ? if so do it as below:
onSelect property of the button say as if(gallery.select.status.value <> detailsscreen.control.status.value, <<send email code>>)

 

I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
Super User II
Super User II

Hi @julleus21 ,

 

if you still see the issue please share with me the screenshots of the APP screen how and where you are updating with formulas I can help you to fix the issue.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

Hi @KrishnaV ,

 

Thanks. I am not sure if I am on the right gallery but I have the following code in onSelect property, SubmitForm(EditForm1)

 

Is this where I need to paste the formula you provided?

 

Hi @julleus21 ,

 

Would you mind sending the formula where you are sending email. Because that is where is the issue exactly.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

Hello @KrishnaV ,

 

I am using Microsoft flow in sending emails and the logic is like the attached.

 

Sorry I am a total newbie into this, so I hope you bear with me. Thank you.

 

 

Hi @julleus21 ,

 

This has to be handled at 3 places, I in SharePoint, PowerApp, and Flow. please follow as below:

  1. onStart property of the App set as below

 

UpdateContext({varUpdateStatusFlag:false})

 

  • Add a new row in the SharePoint as StatusUpdateFlag as Yes/No field
  • Write the below formula OnChange of the status dropdown

 

If(DataCardValue103.Selected.Value <> LookUp(SampleList,ID=4,Status).Value, UpdateContext({varUpdateStatusFlag:true}),UpdateContext({varUpdateStatusFlag:false}))

 

  • on the edit form of the list, item set the status default value as 

 

varUpdateStatusFlag​

 

  • At the time of submitting it will update the updated flag also back to SharePoint list.
  • Now in the flow check this status flag also if it is true and "In-Progress" then send the email if not no email.
  • once you send the email reset the status flag to NO/False

See the working model below to update the list value:
resetting Flag.gif

I am more than happy to share this solution if you see that helps you.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (8,231)