1

I'm working on a project with Sharepoint Online and PowerAutomate, and I have a small issue that I would like to share with you, in order to find solutions or workarounds.

I have a PowerAutomate flow, which is run by a technical user (service account). This flow is triggered by an API call, with some parameters as : requestor user id (which is an existing user in the tenant of course), site id, list it, list item id. The flow retrieve a specific document in a document library (according to parameters passed through the API call) and, at the end of the flow, I would like to publish a major version of this document (check-out + check-in). This is working properly, but there is an issue : as the flow is run as a technical user, when the major version is published, the "Modified by" field is set to the name of the technical user, and not the name of the user which called the API.

I saw that it seems possible to make a call with the specific parameter

"bNewDocumentUpdate": true

to make an update without incrementing the version.

So, at the end of the flow I make the call as follow :

{
    "formValues": [  {
      "FieldName": "Editor",
      "FieldValue": "[{'Key':'i:0#.f|membership|my.user@mytenant.onmicrosoft.com'}]"
        }
    ],
    "bNewDocumentUpdate": true
}

I make the following observations :

  1. If I make this call directly after the major version publishing, the "Modified by" field is well updated with my business user name, but the version is incremented : v2.0 --> call to update editor --> v2.1 which is not satisfactory for my use case
  2. If I make the same call on a minor version, the "Modified by" field is well updated with my business user name, and the version is not incremented : v2.4 --> call to upddate editor --> v2.4 as well

So, my questions are :

  1. How do you explain the fact that the same call produce two different behaviours depending of the version number when I make the call, and do you know a workaround to avoid incrementing the version number ?
  2. Do you have an other idea to troubleshoot this issue? DO you know if there is another way to publish a major version on behalf my business user, despite the fact that the PowerAutomate flow is run as a technical user

Many thanks for your help, and have a great day.

Julien
  • 11
  • 1

0 Answers0