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

Flow update field once another field is no longer blank

I created a flow that when an item in a list is modified and a specific field is no longer blank, the flow updates another field and sends an email.  I want it to then stop, but the email keeps being generated, repeatedly.  How can I make it stop after the initial modification to that field?

 

2019-12-15_16-02-36.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Gristy
Resident Rockstar
Resident Rockstar

Hi,

Hi,

 

You are executing the flow every time the item is modified. You are also modifying the item with the flow so it will constantly repeat.

 

Do the following:

1) Create Column "StartFlow" Single Line of Text set default value to "Yes"

2) On the trigger click the ... go into the settings and set the following start condition 

 

@and(equals(triggerBody()?['StartFlow'],'Yes'), not(empty(triggerBody()?['Lead_x0020_Ope...yourfieldhere'])))

 

You may need to tweak it a bit, but this basically says - run if StartFlow = Yes and Lead field is not empty.

 

3) Move actions outside of the condition

4) delete the condition

5) update the update item function to set StartFlow = No

 

Cheers

 

Chris

 

 

View solution in original post

8 REPLIES 8
Gristy
Resident Rockstar
Resident Rockstar

Hi,

Hi,

 

You are executing the flow every time the item is modified. You are also modifying the item with the flow so it will constantly repeat.

 

Do the following:

1) Create Column "StartFlow" Single Line of Text set default value to "Yes"

2) On the trigger click the ... go into the settings and set the following start condition 

 

@and(equals(triggerBody()?['StartFlow'],'Yes'), not(empty(triggerBody()?['Lead_x0020_Ope...yourfieldhere'])))

 

You may need to tweak it a bit, but this basically says - run if StartFlow = Yes and Lead field is not empty.

 

3) Move actions outside of the condition

4) delete the condition

5) update the update item function to set StartFlow = No

 

Cheers

 

Chris

 

 

View solution in original post

Thanks, Chris.  This is my first time using triggerBody code, so, please bear with.  I haven't  been able to get this to work yet.

 

I updated the code to match my field name: 
@and(equals(triggerBody()?['StartFlow'],'Yes'), not(empty(triggerBody()?['Lead Operator Assigned BY PROD CLERK'])))

 

I followed the capitalization in the field name to be sure.

 

Clicked … next to the "When an existing item is modified" > Settings and added to the code to the bottom: 

1.jpg

 

2.jpg

3.jpg

 

The status doesn't changed to Assigned, StartFlow doesn't change to No, and no email is generated.  What am I doing wrong?

 

Thanks!

 

 

 

 

 

Hi @Gristy - any ideas on my previous reply?  I'm still in a holding pattern.  Had major issues with gateways due to a Microsoft server issue and am now back in play on this.  Any ideas you have- I welcome!

are you saying that the flow does not ever trigger?

 

The expression looks OK, StartFlow will need to be Yes and the other value not empty for it to work.

Correct.  I changed it so Startflow=Yes and it still doesn't generate an email.  😣

Hey

Looking at your screenshow you have used a Yes/No field is that correct?

 

In that case it would be this:

 

@and(equals(triggerBody()?['StartFlow'],true), not(empty(triggerBody()?['Lead Operator Assigned BY PROD CLERK'])))

Hi!  It is single line of text, default to Yes.

2020-01-09_9-34-00.png

2020-01-09_9-35-06.png

It states that it hasn't run in several days.  It isn't being triggered.

2020-01-09_9-36-09.png

 

I decided to go a different route and just create 3 separate flows that fire off as they should, but require a little manual entry by the people involved in the approval to keep it going.   This works for us for now, so I will hold off on trying to fully automate.  Thank you.

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.

Users online (3,311)