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

Triggering flow only on specific Sharepoint column change

I would like to check if a text field is modified in Sharepoint and get the content of it. I wouldn't start the flow for each modification.

I know that @Anonymous(int(triggerOutputs()?[‘body/{VersionNumber}’]),1) is a good start, but it can't check for specific column change.

I can see though that the version history contains the name of the column:

Skoo84_0-1618419747383.png

Is it possible to include the precheck before triggering the actual flow to save on runs?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Skoo84
Frequent Visitor

I was able to start the flow when a column value was changed using the below trigger condition:

@equals(triggerBody()?['Column name']?['Value'],'Value')

You can get the column name by accesing site setting and clicking on the column name:

....../_layouts/15/FldEditEx.aspx?List=%7B8A11B62C%2D5C7C%2D48CF%2DAA83%2DC382A372E85C%7D&Field=Modified

The next step is to immediately change the status to something else, to avoid the loops.

View solution in original post

12 REPLIES 12
CFernandes
Super User
Super User

Hey Mate,

@Skoo84 

 

To save flow runs you can use trigger conditions.

 

For details see - https://tomriha.com/a-simple-way-to-create-a-trigger-condition-in-power-automate/ 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

kierian
Community Support
Community Support

It works only when You know what kind of change do You expect. For example:

@equals(triggerBody()?['(DellOrderStatus)'],'On hold')

But since this is a free text field, I just want to need to know if this is different than before and then start the flow.

Using the method provided in the article, I generated:

@equals(outputs('Get_changes_for_an_item_or_a_file_(properties_only)')?['body/ColumnHasChanged/Requisition_x0020_Notes'], true)

But, I can't use as a trigger.

Hi, I'm aware of this option, but it would start the flow. I want to save on the runs because there are other frequently modified fields as well.

GrobiGer
Frequent Visitor

@Skoo84 did you find a solution for your question? I'm stuck in the same situation.
Trigger will be fired on every change to the column, but I just want it to be fired, when a specific field was changed

Vincent5
Frequent Visitor

Hello everyone,

I have been trying for many days and many researches to set up a trigger based on the value of a multiple choice column. For example if an HR employee chooses Onboarding then the trigger will only fire once.

 

I. I have tried : When an item is created or modified with the condition in the settings:

 

@equals(triggerOutputs()?['body/EmployeeStatus'],'Onboarding')

 

But I get an endless email loop.

 

II. I tried :

1. When an item is created or modified

2. Initialize a variable Name : Onboarding Type : String Value : Notice Period

3. Append to string variable Name : Onboarding Value : ["Value" "Employee status"] Value code view : "@{triggerOutputs()?['body/EmployeeStatus/Value']}"

4. Send an email with outlook. but the system sends emails in a loop.

III. I tried:

1. When an item is created or modified

2. Conditions Employees status equals Onboarding

3. send an email with Outlook

 

Do you have a solution that would work please?

 

Thank you very much for your help.

Hi, 

 

I had the same problem a while back, the above answers @CFernandes / @kierian  really helped me get started, but I did have trouble with writing the expression... 

SimonSmith84_0-1658824549181.png

^^^ This worked for me, where I wanted the workflow to only trigger when the status was equal to 'Resolved'. 

@Vincent5: I think you're having the same issue I did, as the field you're trying to evaluate is a choice field - try throwing "/value" in after EmployeeStatus like this:

@equals(triggerOutputs()?['body/EmployeeStatus/value'],'Onboarding')

 

Unfortunately I don't really have an answer for the original question - As far my (limited) understanding goes, if you want to compare a value to its original value, you'd need the workflow to trigger? 

 

The only workaround I can think of is creating a new field in your data source which updates with the "old" value, and then you can evaluate the old vs the new, and if they're different trigger the workflow. That is however disgustingly messy and I'd be willing to bet someone can think of a much nicer way around the issue. 

@SimonSmith84 Thank you very much for your feedback. I've added value but I get an email that arrives directly when I haven't even selected the Onboarding value.

Vincent5
Frequent Visitor

flow Onboarding.pngA big thank you @MarconettiMarco for his help in this case.

 

The solution is : 

 

1. Select Trigger : When an item or file is modified

2. add action : Get changes for an item or a file (property only)

a) Select the site

b) Select the List

c) Add dynamic content in ID field : ID

d) Add dynamic content in Since field : TriggerWindowStartToken

e) Add dynamic content in Since field : TriggerWindowEndToken

 

3. Add a condition as is : Has column changed Employee status (this is my dynamic content in my case) is true (true must be added manually)

 

4. In yes : add a condition as is : Employee Status Value (in my case) is equal Onboarding (in my case)

 

5. In yes : add you action in my case : send an email with Outlook.

 

Hello @Vincent5 ,

please mark your post as Solved, so that we can consider the issue closed 😀


If you like my response, please give it a Thumbs Up.

BR,

Marco

Hello @MarconettiMarco ,

I'm not the owner of this topic. This is Skoo84.

 

Have a good day.

 

Vincent.

Skoo84
Frequent Visitor

I was able to start the flow when a column value was changed using the below trigger condition:

@equals(triggerBody()?['Column name']?['Value'],'Value')

You can get the column name by accesing site setting and clicking on the column name:

....../_layouts/15/FldEditEx.aspx?List=%7B8A11B62C%2D5C7C%2D48CF%2DAA83%2DC382A372E85C%7D&Field=Modified

The next step is to immediately change the status to something else, to avoid the loops.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,733)