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: Under Review

Hi all,

 

We understand the pain points expressed here, and we are currently investigating options in building granular flow triggers for item updates and column changes in SharePoint.

 

We respectfully ask for your continued patience on this topic for the remainder of this calendar year. We are committed to a viable solution for our customers worldwide, and will continue to post updates here as we solidify our plans (which will most likely be early next year). Again, thank you for your patience, and your feedback on Microsoft Flow integrations with SharePoint.

 

Thanks,

Chakkaradeep (Chaks)

Comments
Level: Powered On

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

 

Level: Powered On

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.

avt
Level: Powered On

@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.
 
Level: Powered On

@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.

avt
Level: Powered On

@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...