cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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
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!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (5,712)