Power Automate: Start a Flow from a column change

With Microsoft Power Automate we can now create flows that start based on specific columns being updated in SharePoint!  This is a feature I have been waiting on for years! The action is called Get changes for an item or a file. The action returns a boolean for each field, whether it was just changed or not. Based on this boolean you know if a field was changed.

Creating the flow

  • Create a SharePoint list, I created the following project list.
  • Enable versioning on the list.
  • Create a flow and use the trigger When an item or a file is modified.
  • Select your site and list.
  • Add the action Get changes for an item or a file (properties only).
  • Fill in the site address, library name and the ID of the item that was triggered.
  • The field Since is used to get the changes we need to make a comparison. If you use 1.0 you will compare the current item version with version 1.0. But we want the latest changes so we use the following expression.
sub(int(triggerOutputs()?['body/{VersionNumber}']),1)
  • I want to send an email when the end date of a project changes.
  • Add the action Conditions to check if the end date was changed.
  • Add the dynamic content Has Column Changed: End date.
    This returns a boolean value.
  • Put the required actions in the If yes section after the condition.
    In my example I am sending an email.
  • Add the action Send an email (V2) and fill in as follows.
Share

10 Replies to “Power Automate: Start a Flow from a column change”

  1. Thank you very much for this clear post, I’ve used this to create two new flows this morning – like you, I’ve been waiting for this for some time!

  2. Thanks for this! I too have been waiting for this trigger and action. You explanation is clear and well done.

    Just wanted to chime in and say thanks

  3. Outstanding work with a very clear writeup. This should really be part of the core documentation in MS Learning. Hats off, Ben!

  4. Unfortunately I got an error in “get changes for an item or a file” which is:
    Specified Version Label does not correspond to any actual version

    I have checked file in my library and I can see all versions in history, so am not really confident what should be changed. Even field “since” was correctly filled with latest version by the formula provided. Any idea what to change?

  5. Hi,
    I get this error:
    ‘Unable to process template language expressions in action ‘Get_changes_for_an_item_or_a_file_(properties_only)’ inputs at line ‘1’ and column ‘2908’: ‘The template language function ‘int’ was invoked with a parameter that is not valid. The value cannot be converted to the target type.’
    Could you please help?
    Regards,
    Daniel

  6. I have three values that will be updated by different teams. I have 3 separate notifications, each set up like above, targeting one of the three fields.

    Currently, this is how notifications are updating:
    Field 1 changed: Notification re: field 1
    Field 2 changed: Notification re: field 1 and field 2
    Field 3 changed: Notification re: field 1, field 2, and field 3

    I have tried to compare to set “since” to 1, I have also used the string above to compare to previous version only.
    I have set up additional conditions, where “has field 1 changed” = y, “has field 2 changed” = no, “has field 3 changed?” = no. This results in “false” so my action does not trigger at all.

    Any help would be appreciated!

  7. I have the same issue as Daniel.

    Power Automate is automatically putting the “Getting changes for an item” action into an “Apply to Each” block. I think that makes this formula wrong: sub(int(triggerOutputs()?[‘body/{VersionNumber}’]),1) as it’s referencing the wrong outputs.

    My Power Automate isn’t up to working out what it should be, I tried sub(int(When_an_item_or_a_file_is_modified()?[‘body/{VersionNumber}’]),1) but that didn’t work either (although it was at least valid!)

  8. In answer to my own question, it should be:

    sub(int(item()?[‘{VersionNumber}’]),1)

    which works nicely!

    I assume Power Automate is adding the “Apply to Each” as it’s possible to get multiple changes in one trigger event, so you need to loop through them all.

Leave a Reply

Your email address will not be published. Required fields are marked *