cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dsmith
Advocate I
Advocate I

Trigger a flow when a SharePoint list item field is updated.

Good Day,

 

Is there currently a way to trigger a flow a field has changed within a SharePoint list item? For example, I have an "Observation Status" column in a SharePoint list. I need a flow to trigger when the value of that column changes from "2-Reviewed" to "3-Open". Thanks for any help!!

65 REPLIES 65
Anonymous
Not applicable

 
Anonymous
Not applicable

Hi Mona Li,

 

how can I found trigger 'when an exisitng item is modified"

I only have these one.

 

 

12-07-17 11-30-09 AM.png

I don't think there is a trigger for "When an item is modified". You have to use "When an item is created or modified" and build your logic accordingly.

Hi @Anonymous,

 

Like @Bizzo said, now Flow has been updated and the trigger When an exsit item is modified is removed and you should use "When an item is created or modified" instead.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-monli-msft,

 

Does the trigger "When an item is created or modified" work when a drop down field/column in a list item is changed? 

 

I have an "Approve/Reject" column in a list item and I tried to set-up a Flow that would send an email notification once the user selects either Approve or Reject from the drop down field. However, nothing seems to happen. I have read in some discusion thread that the drop down control is not supported by Flow trigger....am I right? 

 

Any suggestions?

 

Thanks

Anonymous
Not applicable

How about simple condition like

 

'Created' 'is not equals to' 'Modified'

 

If yes - //logic

if no - Terminate flow with Succeeded status

 

I have an approval process for list items and I wanted to send an approval email only when the status of the item changed from "Ordered" to "Ready".
 
The change of the status "Ordered" to "Ready" is an automized process so I though I would just put a "Wait until" or "Wait" function but this was not possible as the wait time is not always the same. I wanted to send an approval email from the moment it's ready so I have searched for a solution where there would be a check on a specific field. 
 
I tried using switch case or condition but there was a problem when other fields were updated and the condition was already fulfilled, it would send again an approval email:
eg item changed - Status is not "Ready" = Terminate (that's OK)
item changed - Status is "Ready" = send approval email (that's correct) but now item is changed again, other field is updated and the status is still "Ready" = approval email resent (that's not correct as it does not check what was updated" 
 
I did not want to use nested conditions or switch cases.
The solution link provided by grahampasmurf with version checking did the trick!! http://johnliu.net/blog/2018/5/microsoft-flow-sharepoint-trigger-on-specific-fields-changed-via-sp-h...
 
Thank you for that!
 
It did require some adaptation but it works!
 

flowemail1.PNGflowemail2.PNG

 

- ID can be found in "See more" Dynamic content
- SPREST-Versions is just renamed "Send HTTP request to Sharepoint"
- In the Url, if you use space or other special chars, you need to pay attention to how it's written eg space = %20
- Value is the expression from the linked website Body('SPREST-Versions')?['value']
- Orderstatus = valuefield "ValoTeamwork" is not found via Dynamic content but via Output from "Select" When I used the Dynamic content value it did not work as "Valo Teamwork" contained the actual value and was passing it throung to "GroupSiteUrl" from Dynamic content which remaind always the same.
- HTML table is not needed but usefull to debug and make sure it works correctly
- Conditions can again be found on the linked website: first(body('Select'))?['Orderstatus'] - last(body('Select'))?['Orderstatus']

More about approval flow

https://powerusers.microsoft.com/t5/Using-Flows/Flow-and-SharePoint-List-Status/m-p/132299#M3532

I do not have the "When an existing item" listed. How do i get that listed?

"When an existing item is modified" is only available when you create a new flow, it's the initial trigger same as "when an item is created", it's always on top and can not be in the middle of the flow. When you create a new flow, you can choose for it.

Oh ok. Thanks a lot. They need to make that available at any time. Would open up a lot of possibilities.

When running the Http request with the - _api/web/lists/getbytitle("zzTest")/items(@{triggerBody()?['ID']})/versions?$top=2 it returns the following error:


{
  "status": 400,
  "message": "{\"odata.error\":{\"code\":\"-1, Microsoft.SharePoint.Client.InvalidClientQueryException\",\"message\":{\"lang\":\"en-US\",\"value\":\"The expression \\\"web/lists/getbytitle(\\\"zzTest\\\")/items(1)/versions\\\" is not valid.\"}}}\r\nclientRequestId: 3cb27048-f995-4e07-ab4c-bd3dbd9baf3d\r\nserviceRequestId: 0d8da49e-f0b4-7000-4dda-d8d0041f4589",
  "source": "https://COMPANYNAME.sharepoint.com/sites/PHForum/_api/web/lists/getbytitle(%22zzTest%22)/items(1)/ve...",
  "errors": []
}

 

When entering the URL in the browser it provides me following information, i am not sure where i need access in order to be provisioned with the correct return:


<?xml version="1.0" encoding="UTF-8"?>
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code>-2147024891, System.UnauthorizedAccessException</m:code>
<m:message xml:lang="en-US">Access denied. You do not have permission to perform this action or access this resource.</m:message>
</m:error>

 

Would you know?

I would recommend you try a quick test using JSOM. You should be able to modify the code below and run it in your console. The error message you get back (assuming it fails) will hopefully provide more information to help troubleshoot the problem.

 

Source

 

function retrieveListItems(siteUrl) {
    var clientContext = new SP.ClientContext(siteUrl);
    var oList = clientContext.get_web().get_lists().getByTitle('Announcements');

    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml(
        '<View><Query><Where><Geq><FieldRef Name=\'ID\'/>' + 
        '<Value Type=\'Number\'>1</Value></Geq></Where></Query>' + 
        '<RowLimit>10</RowLimit></View>'
    );
    this.collListItem = oList.getItems(camlQuery);

    clientContext.load(collListItem);
    clientContext.executeQueryAsync(
        Function.createDelegate(this, this.onQuerySucceeded), 
        Function.createDelegate(this, this.onQueryFailed)
    ); 
}

function onQuerySucceeded(sender, args) {
    var listItemInfo = '';
    var listItemEnumerator = collListItem.getEnumerator();

    while (listItemEnumerator.moveNext()) {
        var oListItem = listItemEnumerator.get_current();
        listItemInfo += '\nID: ' + oListItem.get_id() + 
            '\nTitle: ' + oListItem.get_item('Title') + 
            '\nBody: ' + oListItem.get_item('Body');
    }

    alert(listItemInfo.toString());
}

function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + 
        '\n' + args.get_stackTrace());
}

 

thx for this but i am not a developer so am not familiar with tools to check etc, i would need to figure out another way why this line does not work. which is a pity.

In your browser, clicking F12 will get you developer tools. When that opens, looks for something that says Console. Click to set your cursor in the window, paste the following code, and press enter.

 

function retrieveListItems() {
    var clientContext = new SP.ClientContext.get_current();
    var oList = clientContext.get_web().get_lists().getByTitle('zzTest');

    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml(
        '<View><Query><Where><Geq><FieldRef Name=\'ID\'/>' + 
        '<Value Type=\'Number\'>1</Value></Geq></Where></Query>' + 
        '<RowLimit>10</RowLimit></View>'
    );
    this.collListItem = oList.getItems(camlQuery);

    clientContext.load(collListItem);
    clientContext.executeQueryAsync(
        Function.createDelegate(this, this.onQuerySucceeded), 
        Function.createDelegate(this, this.onQueryFailed)
    ); 
}

function onQuerySucceeded(sender, args) {
    var listItemInfo = '';
    var listItemEnumerator = collListItem.getEnumerator();

    while (listItemEnumerator.moveNext()) {
        var oListItem = listItemEnumerator.get_current();
        listItemInfo += '\nID: ' + oListItem.get_id() + 
            '\nTitle: ' + oListItem.get_item('Title');
    }

    alert(listItemInfo.toString());
}

function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + 
        '\n' + args.get_stackTrace());
}

retrieveListItems();

I made a couple simple changes from the original code copied from Microsoft. You need to be on a page from the site with the list, zzTest. Make sure your list has a few items in it. Other than that, it's ready to go. Hopefully that helps!

 

sharepoint_get-list-items_chrome-console.png

Edit: Added screenshot of Chrome developer tools.

Thanks for this

In Edge

All i receive on Edge is 'SP is not defined'

SCRIPT5009 'SP' sp is not defined

and the same on Chrome

I tried this with 2 users one which has site collection admin rights

 

My apologies. Apparently this won't work on a Modern site. There's a few workarounds on GitHub, but I don't think it makes sense to go that far. You'll need to find another way to test this and get more info. Sorry... 😞

Anonymous
Not applicable

Hello.  Hope you can help.

 

Your instruction worked perfectly, but you mentioned doing the following 

 

"IMPORTANT - last step in this side of the flow needs to set Revised Inspection Date Original equal to Revised Inspection Date."

 

How do you do that?  What control do you use to make that happen?  Help!!!

That's great you got it working! 🙂

 

Add one final step to your flow: SharePoint -> Update item. In that step, you'd leave everything "as is" and update Revised Inspection Date Original to equal Revised Inspection Date. Something like this.

 

microsoft-flow_single-field-updated_final-update.png

 

Hopefully that makes sense, but please let me know if you have any questions.

I am having a similar issue witht the notifications, but I would only like to get notified when 1 item in the list get changes. Its a check box that would be set from true to false. Right now, I am getting notified for all changes that are being made to the list, and just had to delete about 200 emails.

Hi i have tried to get my flow to work this way.

My column i want to check is called Comments, it contains multiple lines of text and i just want the flow to check if this have been updated if yes send email.

 

I get this when error.

BadRequest. The 'from' property value in the 'select' action inputs is of type 'Object'. The value must be an array.

 

Im not a coder, i do understand that maybe the column cant be a text column?

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (1,251)