0

I have created a workflow which runs on item created. That workflow add the attachment to that list item but running that workflow also updates the Modified by. Suppose User_A has created the item and Created by/ Modified by shows User_A which is good so far but as soon as power automate flow runs and add the attachment to that list, it updates Modified by field by my name which I want to avoid. It should be the same user who created the item.

I can later update the modified by to user who created the item but it creates a version of my name.

Can I run that workflow with user who created the item ? so whenever attachment is add, the modified field reflects the name of that user

Any suggestions ?

1 Answer 1

1

Creating flows that run for other users when an item is created/modified should never really run with the credentials of the workflow developwer. You also should not own that flow. When you leave the organisation and your account gets removed and unlicensed, all these flows will break.

The recommended practice is to use a service account specifically for owning and running workflows. You can develop and test the flow with your credentials, but then it should be published by your IT department, using the service account credentials (which only IT should know). That account will never be removed from AD, so the workflows will stay alive when you leave, and IT has an overview of all workflows that do automation.

With that approach, it is also a lot easier to justify that the list item has an entry in its version history under the service account. This edit is done by the automated process, so it is a valid edit that needs to be in the audit trail.

To do:

  • have your IT department set up a service account like PowerAutomate@yourcompany.com
  • that account needs a license for Power Automate and SharePoint. Typically, the same license that you have in O365.
  • ensure that the service account has sufficient permissions to read and edit the SharePoint sites/lists it needs to work with
  • export the workflow and send the exported ZIP to your IT folks
  • Using the service account credentials, IT imports the workflow, changes the connections from your account to the workflow account.
  • Using the service account credentials, IT shares the workflow with you, so you can make edits without going through the export/import process each time.

The initial setup is a bit more work, but this approach is robust, sustainable, and provides the audit trail required.

6
  • Thank you for your detail answer. Just a question suppose there are many Power automate developers and each sending request to IT for publish to generic account , how IT would trace if any issue comes. example Developer A created workflowA and that is published by IT under service account but later Developer B update that workflowA and required IT to publish under service account and Developer C also puts some update to that workflow and IT publish the same workflow under that service account.....
    – Saira
    Sep 13, 2021 at 2:01
  • 1
    You are describing a software life cycle problem that is not unique to PowerApps. Ideally, you have a development environment and all the flows published in production have been thoroughly tested and documented. When an issue comes up, your priority is to fix the bug, not to find out which programmer caused it.
    – teylyn
    Sep 13, 2021 at 20:43
  • yes but at times its easy to fix the bug by the same developer.
    – Saira
    Sep 13, 2021 at 21:32
  • Suppose there are many workflows , Is there any way to know for IT who created that workflow without looking into the document ? I am just thinking if power developers publish workflows by their AD and only IT update the relevant connections , but again issue would come what if that person leaves the organisation .......
    – Saira
    Sep 13, 2021 at 22:55
  • 1
    This is a matter of governance and behaviour. There is a description field in each flow that can be used for some details. There are many ways to document a workflow and its changes. But these require that the PEOPLE actually stick to the rules and use them. If any change to a workflow in production is documented, with words, screenshots, dated, linked to a person, etc, then IT has a great resource to consult. If, however, there is a culture of making changes without any documentation before riding off into the sunset, well, that cannot be solved with technology.
    – teylyn
    Sep 14, 2021 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.