How to use Microsoft Flows to invoke a calling user from D365 to SharePoint?

If your Dynamics 365 instance is integrated with SharePoint, then all attachments to entity records within Dynamics 365 will be synced to SharePoint. However, by default the “Modified By” field under Documents bears the name of the user whose credentials was used for the integration. This is incorrect as it won’t give us the names of other calling users who might add attachments to CRM records, which get synced to SharePoint but under the first username. This is where we are trying to provide a solution by using Microsoft Flows.


       1. Dynamics 365 System Admin privileged user.

       2. SharePoint read and write permission for the first user on whose credentials the integration is done.

       3. Second user (calling user) with normal privileges to test.

       4. Microsoft Flow.

       5. A custom field in SharePoint site to update the calling user from CRM.

Solution Procedure:

      1. Navigate to Flows in your Tenant and create new flow using existing template “Dynamics 365 to SharePoint”


      2. Select “Create from template.”


      3. Create the SharePoint and Dynamics 365 and continue.


     4. Configure the Organization Name and Entity name.


     5. Add item identifier item as “Created By” from dynamic content.


     6. Add the conditions “If Yes” as follows.


     7. Add condition for Title value as below.


     8. Now fill the Yes condition.


        Provide SharePoint site URL, Folder path, File Name and File Content.


   9.  From the above step record using created file id, we are updating metadata of uploaded file.


 10. Send the request to SharePoint to update the “Created By” calling user to SharePoint

        In SharePoint we have created a custom field with name “Own user” to insert this calling user from Dynamics 365.




         Note: here itemid is dynamic content.





        "FieldName": "OwnUser",

        "FieldValue": “enter value here static or dynamic”




11. Save the configuration and test it.


12. Create a test note with a attachment in CRM using second user and it should sync to Sharepoint with “Created by” user in custom field in sharepoint.



You can clearly notice that the new attachment added in CRM by the second user reflects in SharePoint with the second username only under Own User field.


In case of any queries, please feel free to email us at