cancel
Showing results for 
Search instead for 
Did you mean: 

Create a trigger for SharePoint list columns

It would be nice to have a trigger if a certain column in a SharePoint list is modified. For example, if the column "Status" is modified, or if the column "Assigned To" is populated. So we don't have to use the trigger "When an item is created or modified", where you have to create a lot of workaround conditions just to make sure that the column that was updated is what you need. 

Status: Completed

Hi all,

 

Happy to update that this feature is now rolled out to and available for use. The documentation is updated as well:

For more info about how to use this action, see this tutorial: Introducing 'when an item or file modified' trigger and 'Get changes' action

 

Thank you all for the feedback and please let us know if you have any questions.

 

Thanks,

Chakkaradeep

Comments
Advocate IV

Agreed! The "When an item is created or modified" is triggered too often. I work around this by creating a condition, but the flow is firing constantly and wastes far too many of my allotted flows per month. I want to be able to trigger a flow when more specific criteria within a library is met.

Kudo Collector
Kudo Collector

@themsenduser@Pieter_Veenstra

 

Hello,

I think you missed the thread headline, the problem is with SHP lists, not documents library, the workaround mentioned in https://powerusers.microsoft.com/t5/Microsoft-Flow-Community-Blog/Using-Metadata-Values-Triggers-for... is about document libraries not SHP lists.

 

Correct me If I am wrong, I would love to be wrong 🙂 as I need this too...

 

Advocate IV

@Pieter_Veenstra

 

"There are also solutions possible where you can trigger on a single field {...}."

 

What are those solutions? That is what I need.

New Member

Bonjour,

Je confirme que c'est aussi mon besoin pour faire des flux dignes de ce noms sur les listes SharePoint.

Merci.

Cordialement.

Advocate IV

I voted!

 

Please be a lad and vote my idea, to increase the approval timeout (or just general timeout) of flows to MORE THAN 30 DAYS!!

 

I'm at 155 votes, more is better.

Thanks!!

 

https://powerusers.microsoft.com/t5/Flow-Ideas/Increase-approval-timeout-to-more-than-30-days/idi-p/...

Helper I

Microsoft what is the status of this feature? When can we expect to see this implemented or not.

 

Advocate IV

This is really really really really really really really really really really really really really really really really really really

Oops, forgot to add a condition...

NEEDED!!!!!!

 

In all seriousness, lists become exceedingly complicated to configure when trying to avoid never ending loops and flow firing constantly.

 

Please Microsoft.

Kudo Collector
Kudo Collector

@samstarzy hi I have a workaround for this 🙂

 

1. use SHP triger - When an item is created or modified

 

2. Send an HTTP request to Sharepoint:

 

image.png

where ID is from trigger body;

and the $top=10 equals number of versions you want to retrieve (I use 10 because I use compose html table to create a neat table of versions in email notifications; this must be atleast 2 so you can compare versions later)

 

3. Select

image.png

Blue ones are - item ()['VersionLabel'] etc..

Purple ones are: 

reqdeldate - where i trim the last chars for clarity 

 

formatDateTime(addHours(item()?['Requested_x005f_x0020_x005f_Delivery_x005f_x0020_x005f_D'],5),'yyyy-MM-dd')
 
agreeddate;dateofdel: where I check for null value as it is not a mandatory SHP collumn, flow will crash if you dont do that 🙂
 
if(equals(item()?['Agreed_x005f_x0020_x005f_Delivery_x005f_x0020_x005f_Date'],Null),'Empty',formatDateTime(addHours(item()?['Agreed_x005f_x0020_x005f_Delivery_x005f_x0020_x005f_Date'],5),'yyyy-MM-dd'))
 
4. htmltable from Select output 
 
5. compose (to make the default table have borders 🙂 )
replace(body('htmltable'),'<table>','<table border="1" style="border-collapse: collapse" cellpadding="5">')
 
6. condition - so if this is the first version the flow will stop and no notifications will be send
@equals(string(first(body('Select'))?['vlabel']), string('1.0'))
if yes - terminate flow
if no - empty
 
7. condition - this one checks collumn from select and it compare the last version and the one before it
@equals(first(body('Select'))?['dateofdel'], first(skip(body('Select'), 1))?['dateofdel'])
if yes - empty
if no - send email notification with the compose output that the collumn value was changed
 
8. repeat step 7 for as many collumns you want
 
optional, you can create another array to store the changed collumns (append to it in conditions and send notification at the end of the flow) so you dont create 10 notifications when 10 collums are changed.
 
Advocate IV

@avt

That is quite a response. It seems that the flow will still trigger anytime an item is modified though. If that is the case, your solution will trigger just as often as it would if there were a conditional statement that checks if the metadata for that column is equal to a particular value.

Both are triggering far too often to be scaled as a workflow within an organization. At the end of the day, both methods waste a large amount of the monthly flow quota.

Kudo Collector
Kudo Collector

@samstarzy

well, yes, but honestly I have never hit a MS flow limit, including one time almost 2 years ago when I screwed up and did not know how easy is to create an infinite loop when using SHP modified trigger 🙂

 

Used 200% of my company quota 🙂 MS never asked for any money for that (afaik), btw kodos to @ms for that, I suspect it was still to early in development - maybe 3 months after first public MS flow preview

 

my point being, we have about 30-40 flows, 15 of them are SHP modified triggers, and we never ran out of our quota, so I wouldnt sweat it.

 

I guess it depends on your use case and # of users in your tenant...