SharePoint list items change a lot, and it’s handy to know when they do. So today we’ll check the “When an item is created or modified” that helps us to know when changes happen in the list and act on them.

Where to find it?

To find it you can search for SharePoint “When an item is created or modified” action, or go to “SharePoint”:

Then select the action:

Here’s what it looks like:

Pro Tip Power Automate tends to save the most common triggers in the main screen, so check there before going trough the full hierarchy. Also you can use the search to quickly find it.

Let’s look on how to use it.

Usage

The setup is quite simple. You pick your site and list, and Power Automate does all the work for you. Optionally you can also choose a view that will limit the columns that SharePoint will return. Limiting lists with many rows and columns makes things a lot faster and easier to manage on your Flow.

Please note that the view will only filter the columns and not the rows. If you have filters in the view they will be ignored

Please note that the “When an item is created or modified” will not trigger deleted items. Instead, you have a separate trigger, the “When an item is deleted,” to deal with that.

Outputs

The trigger returns a lot of information in a JSON format, although the conversion from JSON is done automatically for you. Here’s an example:

{
    "headers": {
        "Transfer-Encoding": "chunked",
        "Retry-After": "21600",
        "Vary": "Origin,Accept-Encoding",
        "X-SharePointHealthScore": "1",
        "X-MS-SPConnector": "1",
        "X-SP-SERVERSTATE": "ReadOnly=0",
        "DATASERVICEVERSION": "3.0",
        "SPClientServiceRequestDuration": "175",
        "SPRequestGuid": "ef806fa7-6a4c-4434-883e-ff5466a91761",
        "request-id": "0c60ef00-24f5-11ec-9621-0242ac130002",
        "MS-CV": "<redacted>",
        "Strict-Transport-Security": "max-age=31536000",
        "X-FRAME-OPTIONS": "SAMEORIGIN",
        "Content-Security-Policy": "frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com *.powerapps.com *.yammer.com *.officeapps.live.com *.office.com *.stream.azure-test.net *.microsoftstream.com;",
        "MicrosoftSharePointTeamServices": "16.0.0.21722",
        "X-Content-Type-Options": "nosniff",
        "X-MS-InvokeApp": "1; RequireReadOnly",
        "Timing-Allow-Origin": "*",
        "x-ms-apihub-cached-response": "true",
        "Cache-Control": "max-age=0, private",
        "Date": "Mon, 04 Oct 2021 09:24:15 GMT",
        "Location": "<redacted>",
        "P3P": "CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"",
        "X-AspNet-Version": "4.0.30319",
        "X-Powered-By": "ASP.NET",
        "Content-Type": "application/json; charset=utf-8",
        "Expires": "Sun, 19 Sep 2021 09:24:15 GMT",
        "Last-Modified": "Mon, 04 Oct 2021 09:24:15 GMT",
        "Content-Length": "1808"
    },
    "body": {
        "@odata.etag": "\"1\"",
        "ItemInternalId": "4",
        "ID": 4,
        "Title": "Created",
        "Modified": "2021-10-04T09:24:14Z",
        "Created": "2021-10-04T09:24:14Z",
        "Author": {
            "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
            "Claims": "i:0#.f|membership|manuel@manueltgomes.com",
            "DisplayName": "Manuel Gomes",
            "Email": "manuel@manueltgomes.com",
            "Picture": "https://manueltgomescom.sharepoint.com/sites/Test/_layouts/15/UserPhoto.aspx?Size=L&AccountName=manuel@manueltgomes.com",
            "Department": null,
            "JobTitle": null
        },
        "Author#Claims": "i:0#.f|membership|manuel@manueltgomes.com",
        "Editor": {
            "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
            "Claims": "i:0#.f|membership|manuel@manueltgomes.com",
            "DisplayName": "Manuel Gomes",
            "Email": "manuel@manueltgomes.com",
            "Picture": "https://manueltgomescom.sharepoint.com/sites/Test/_layouts/15/UserPhoto.aspx?Size=L&AccountName=manuel@manueltgomes.com",
            "Department": null,
            "JobTitle": null
        },
        "Editor#Claims": "i:0#.f|membership|manuel@manueltgomes.com",
        "{Identifier}": "Lists%252fCreatedAndModified%252f4_.000",
        "{IsFolder}": false,
        "{Thumbnail}": {
            "Large": null,
            "Medium": null,
            "Small": null
        },
        "{Link}": "<redacted>",
        "{Name}": "Created",
        "{FilenameWithExtension}": "Created",
        "{Path}": "Lists/CreatedAndModified/",
        "{FullPath}": "Lists/CreatedAndModified/4_.000",
        "{HasAttachments}": false,
        "{VersionNumber}": "1.0",
        "{TriggerWindowStartToken}": "<redacter>",
        "{TriggerWindowEndToken}": "<redacted>"
    }
}

A lot is happening here, but we only need to focus on the “body” part. It’s pretty similar to other everyday actions like the “Get items” action, for example. First, we’ll get all columns from the SharePoint list.

SharePoint will return the same results if the item is created or updated.

Since the returns are the same, there’s an easy way to understand if the item was created or updated. Since SharePoint considered the creation of a file as a modification, both dates will be the same. So you can have a “Condition” action that separates both behaviors.

Power Automate will only return the last changes. Suppose you want to understand how to get the previous versions of items in SharePoint lists. In that case, I have a template and a detailed explanation of how to do it on my “How to get previous versions in SharePoint” article.

Limitations

Although Microsoft is quite clear on the behavior, I think it’s configuring to pick views without filtering the data. The label is clear “Limit Columns by View,” but I think it would be amazing to have a filtered list and only trigger if the elements of that list were updated.

Recommendations

Here are some things to keep in mind.

Always pick from the list.

Always pick the site address and the list name from the list. You can define them manually, but there’s no added value in doing that.

Don’t use this for synchronization.

I see many questions regarding synchronization between SharePoint lists, and the “When an item is created or modified “trigger is an excellent target to catch items that need replication. But I would strongly advise you not to do it. Synchronization of items is an amazingly complex topic in computer science, and we are all super when something doesn’t synchronize properly. If the trigger fails for some reason, data will be out of sync, and Power Automate won’t rerun it. If the data is changed on the destination list, you already have a problem that will only worsen over time.

Name it correctly

The name is super important in this case since we can get the trigger from anywhere and with anything. Always build the word so that other people can understand what you are using without opening the action and checking the details.

Always add a comment.

Adding a comment will also help to avoid mistakes. Indicate what you’re expecting, why the Flow should be triggered, and the data used. It’s essential to enable faster debugging when something goes wrong.

Am I missing something? Leave a comment or interact on Twitter. Let’s work together to make this reference as complete as we can

Photo by Alice Dietrich on Unsplash

Back to the Power Automate Trigger Reference.

Manuel Gomes

I'm a Project Manager with experience in large projects and companies. I've worked in the past for companies like Bayer, Sybase (now SAP) and I'm currently working for Pestana Hotel Group.

View all posts by Manuel Gomes →

2 thoughts on “Power Automate: When an item is created or modified Trigger

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: