cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rajkumar88
Level: Powered On

issue: flow running continously even after sending an email

Hello Everyone,

 

I am having major problem. My flow is sending multiple emails to the respective manager.

 

stpes: When a new item is created or modified
2.GetManager(v)// userupn=createdbyemail

3. update an item  // here I am updating list item with Manager name under Manager text  field

4. condition Managertextfield is equal to "Displayname" (from step2)

5. if yes then condition: emailrigger.value is equal to "Yes"

6. if yes → then send an email to Manager, if it is NO then "Terminate" as success

7. after email sent then→ update an item //here I am updating emailtriggervalue as "Done".

8.Terminate = success

 

Am I using wrong trigger as a starting point? in the front I am using PowerApps where users can save thier content. However if user "clicks on SAVE" then my flow should not trigger an email. It should trigger if they click on "submit" button. My submit button will make "emailtrigger.value=YES" . based up on that I am running above flow.

13 REPLIES 13
Dual Super User
Dual Super User

Re: issue: flow running continously even after sending an email

I think you want the When an item is Created trigger, not the When an item is created or modified.  Your Flow is modifying the item and I think that is why the Flow is restarting.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
rajkumar88
Level: Powered On

Re: issue: flow running continously even after sending an email

@Pstork1 ,

 

but the issue is that, my users are first creating an item using PowerApps. so it will create a new item item in list. Here I am using "Save" button which is technically on the backend it creates new item in the list. 

 

However when they clik on "Submit" button then it will update the exisiting item. My flow should run only when they select "submit" button due to which I selected when it modifies an item too. 

 

If I make it as when item is created the it wil neve send an email to the Manager after that submit button. 

 

is there a way where I can schedule for every 10mins, looks for all submitted ones (add condition emailSentcolumn=notyet) then send an email to those users only? 

something like

1.recurrence

2. get items

3. apply to each →condition→if emailsentcolumn is equal to "Notyet" 

                           → then send an email for each of the created by user? 

 

let mw know which step I can use in a better way Please

Dual Super User
Dual Super User

Re: issue: flow running continously even after sending an email

If you want the flow to only run when they submit then Trigger the flow with the PowerApps button and pass the iD of the item to the Flow.  Then the Flow can do a Get Item to get that item and update it.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
rajkumar88
Level: Powered On

Re: issue: flow running continously even after sending an email

@Pstork1

I tried before in that way but it doesn’t seems to work properly as my submit button has several lines of code. It’s not working at all. That’s why I want to use flow outside of powerapps.

Can i use recurrence and get all items and for each time verify condition and then send an email. Can you please let me know the steps that needs to be used. Sorry I am bit confused here
Dual Super User
Dual Super User

Re: issue: flow running continously even after sending an email

That's a lot of extra runs for little benefit.  Its just going to cause more issues.  You might try putting the Flow run in the OnSuccess property for the form instead of OnSelect for the button. But given what you describe call the Flow directly from the PowerApp is the right way to do it.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
rajkumar88
Level: Powered On

Re: issue: flow running continously even after sending an email

@Pstork1,
So the steps would be 1.powerapps button
2.get item?
And in Powerapps just connect it to Onsucess of the button?
Dual Super User
Dual Super User

Re: issue: flow running continously even after sending an email

Buttons don't have ONSuccess, but if you are submitting a Form using a Button the Form has an OnSuccess property.  What other commands are you doing in the OnSelect in the button?



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
rajkumar88
Level: Powered On

Re: issue: flow running continously even after sending an email

@Pstork1 

 

I have Save button. This one is used to save data in splist. But email should not trigger based up on the. And when I using “submit” button I am also updating column called “email triggered” equal to YES. So the flow will run if this Only YES.

Dual Super User
Dual Super User

Re: issue: flow running continously even after sending an email

If the Flow will only run if the column is Yes and yiou are updating the column when you press the button why not have the Flow update the field to Yes and just have the button start the Flow?



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
rajkumar88
Level: Powered On

Re: issue: flow running continously even after sending an email

@Pstork1,

 

if we do in that way, then how can we determine if user selected "Save" button or submit button?

Dual Super User
Dual Super User

Re: issue: flow running continously even after sending an email

If they click the submit button the Flow runs.  If they click the Save button the Flow doesn't run.  Or am I missing somthing in your design?



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
rajkumar88
Level: Powered On

Re: issue: flow running continously even after sending an email

@Pstork1,

 

thanks true. I am bit new these things, so confused.

may I know exact steps.

 

on sucess on the form → I need to just add the FLOW.

in flow → steps: 1. PowerApps Button

2. get item

3. update item "emailtrigeered column =YES"

4. condition → column is equalto yes

5. then send an email

 

if we do in this way, what about "SAVE" button? if users click on save button then it will also be considered as success right?

and also I am not suing "Form" on the last screen. I am using a screen with "canvas" property to display all the previously selected item. Here is the screens hot.

flow.PNG

Dual Super User
Dual Super User

Re: issue: flow running continously even after sending an email

two modifications.  1) if Flow is going to set the field to Yes then there is no reason to check to make sure its yes.

2) YOu launch the Flow from the ONSelect of the Submit button. It should work now since we've decreased the logic since the submit button no longer has to set the field to yes.  The Save button does what it has always done.  Since onSuccess doesn't launch the Flow neither does the Save button.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 325 members 5,664 guests
Please welcome our newest community members: