PowerAutomate Flow: Change SPListItem Author without increasing version number

Problem

I need to change the Created By (Author) of list item without increasing version number via PowerAutomate Flow but unfortunately there's no predefined action that is ready for use.

Solution

Use list API via Send an HTTP request to SharePoint action as follows.

Note: to prevent new version of list item from being created, set "bNewDocumentUpdate":true 


{
    "inputs": {
        "host": {
            "connection": {
                "name""@parameters('$connections')['shared_sharepointonline']['connectionId']"
            }
        },
        "method""post",
        "body": {
            "method""POST",
            "uri""_api/web/lists/getbytitle('@{variables('ListTitle')}')/items(@{variables('ListItemID')})/validateUpdateListItem",
            "body""{\n\"formValues\":[{\"FieldName\":\"Author\",\"FieldValue\":\"[{\\\"Key\\\":\\\"@{triggerBody()?['RequestingOfficer']?['Claims']}\\\"}]\"}],\n\"bNewDocumentUpdate\":true\n}"
        },
        "path""/datasets/@{encodeURIComponent(encodeURIComponent('https://YOUR-TENANCY.sharepoint.com/sites/YOUR-SITE-COLLECTION'))}/httprequest",
        "authentication""@parameters('$authentication')"
    },
    "metadata": {
        "flowSystemMetadata": {
            "swaggerOperationId""HttpRequest"
        }
    }
}

Comments

Popular posts from this blog

How to search Active Directory group members using Windows 10 built-in tools

How to check and reload PAC (Proxy Auto Configuration) file on Windows