cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Microsoft Flow - Impersonate User while uploading file to sharepoint

Hi,

 

I am uploading files to the SharePoint using Microsoft Flow. The 'Created By' column in SharePoint Document Library shows the name of the System Account which is being used to connect MS Flow to the SharePoint.

 

I wish to show the name of the actual user, who has uploaded the file. I have the email ID of the user who has uploaded the file. 

 

Is there a way through which i can resolve the User object corresponding to the email ID and set it in the created by field in sharepoint? Also, is there a way to impersonate as a particular user while uploading the file?

 

Regards,

Namit

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Microsoft Flow - Impersonate User while uploading file to sharepoint

Hi @namit_gupta,

 

Do you want to change the value of the Created field of the SharePoint Document Library to the person who actually uploaded the file, rather than the connection account of the configuration of the Flow that uploaded the file?

I tried using the Send Http request to SharePoint action to change this property via the Post method, but when I proceeded to configure the Request Body, I found no way to get the specific information of the Created property.

In general, the Created property contains the following, but there is no way to indicate in the Request body that the property needs to be changed:

16.PNG

This is my attempts, it can change some other properties, but there seems to be no way to change Created:

17.PNG

<?xml version="1.0" encoding="utf-8"?>
<entry xml:base="https://beatrng.sharepoint.com/sites/tes/_api/"
    xmlns="http://www.w3.org/2005/Atom"
    xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
    xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
    xmlns:georss="http://www.georss.org/georss"
    xmlns:gml="http://www.opengis.net/gml" m:etag="&quot;22&quot;">
    <id>4d64755d-e7b0-4ab6-8f88-27c9e84c0014</id>
    <category term="SP.Data.TRONItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <link rel="edit" href="Web/Lists(guid'70d3b5ce-6dfd-4a24-8dd0-d417ccc97754')/Items(1)" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FirstUniqueAncestorSecurableObject" type="application/atom+xml;type=entry" title="FirstUniqueAncestorSecurableObject" href="Web/Lists(guid'70d3b5ce-6dfd-4a24-8dd0-d417ccc97754')/Items(1)/FirstUniqueAncestorSecurableObject" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/RoleAssignments" type="application/atom+xml;type=feed" title="RoleAssignments" href="Web/Lists(guid'70d3b5ce-6dfd-4a24-8dd0-d417ccc97754')/Items(1)/RoleAssignments" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/AttachmentFiles" type="application/atom+xml;type=feed" title="AttachmentFiles" href="Web/Lists(guid'70d3b5ce-6dfd-4a24-8dd0-d417ccc97754')/Items(1)/AttachmentFiles" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ContentType" type="application/atom+xml;type=entry" title="ContentType" href="Web/Lists(guid'70d3b5ce-6dfd-4a24-8dd0-d417ccc97754')/Items(1)/ContentType" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/GetDlpPolicyTip" type="application/atom+xml;type=entry" title="GetDlpPolicyTip" href="Web/Lists(guid'70d3b5ce-6dfd-4a24-8dd0-d417ccc97754')/Items(1)/GetDlpPolicyTip" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesAsHtml" type="application/atom+xml;type=entry" title="FieldValuesAsHtml" href="Web/Lists(guid'70d3b5ce-6dfd-4a24-8dd0-d417ccc97754')/Items(1)/FieldValuesAsHtml" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesAsText" type="application/atom+xml;type=entry" title="FieldValuesAsText" href="Web/Lists(guid'70d3b5ce-6dfd-4a24-8dd0-d417ccc97754')/Items(1)/FieldValuesAsText" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesForEdit" type="application/atom+xml;type=entry" title="FieldValuesForEdit" href="Web/Lists(guid'70d3b5ce-6dfd-4a24-8dd0-d417ccc97754')/Items(1)/FieldValuesForEdit" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/File" type="application/atom+xml;type=entry" title="File" href="Web/Lists(guid'70d3b5ce-6dfd-4a24-8dd0-d417ccc97754')/Items(1)/File" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Folder" type="application/atom+xml;type=entry" title="Folder" href="Web/Lists(guid'70d3b5ce-6dfd-4a24-8dd0-d417ccc97754')/Items(1)/Folder" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/LikedByInformation" type="application/atom+xml;type=entry" title="LikedByInformation" href="Web/Lists(guid'70d3b5ce-6dfd-4a24-8dd0-d417ccc97754')/Items(1)/LikedByInformation" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ParentList" type="application/atom+xml;type=entry" title="ParentList" href="Web/Lists(guid'70d3b5ce-6dfd-4a24-8dd0-d417ccc97754')/Items(1)/ParentList" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Properties" type="application/atom+xml;type=entry" title="Properties" href="Web/Lists(guid'70d3b5ce-6dfd-4a24-8dd0-d417ccc97754')/Items(1)/Properties" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Versions" type="application/atom+xml;type=feed" title="Versions" href="Web/Lists(guid'70d3b5ce-6dfd-4a24-8dd0-d417ccc97754')/Items(1)/Versions" />
    <title />
    <updated>2018-10-23T07:24:14Z</updated>
    <author>
        <name />
    </author>
    <content type="application/xml">
        <m:properties>
            <d:FileSystemObjectType m:type="Edm.Int32">0</d:FileSystemObjectType>
            <d:Id m:type="Edm.Int32">1</d:Id>
            <d:ServerRedirectedEmbedUri m:null="true" />
            <d:ServerRedirectedEmbedUrl></d:ServerRedirectedEmbedUrl>
            <d:ID m:type="Edm.Int32">1</d:ID>
            <d:ContentTypeId>0x010100F814846D7396F241BD1A1A9D7D082531</d:ContentTypeId>
            <d:Created m:type="Edm.DateTime">2018-10-23T05:39:40Z</d:Created>
            <d:AuthorId m:type="Edm.Int32">6</d:AuthorId>
            <d:Modified m:type="Edm.DateTime">2018-10-23T06:46:32Z</d:Modified>
            <d:EditorId m:type="Edm.Int32">6</d:EditorId>
            <d:OData__CopySource m:null="true" />
            <d:CheckoutUserId m:null="true" />
            <d:OData__UIVersionString>22.0</d:OData__UIVersionString>
            <d:GUID m:type="Edm.Guid">55383cde-f7b3-48be-aa8e-0589f67e0fb9</d:GUID>
            <d:ComplianceAssetId m:null="true" />
            <d:Title>TestUpdated</d:Title>
        </m:properties>
    </content>
</entry>

Properties does not seem to contain the relevant content of Created.

Some links that can be referenced:

managed-metadata-fields

update-list-item-in-sp-2013-using-rest

working-with-lists-and-list-items-with-rest

working-with-folders-and-files-with-rest

 

I am afraid there is no suitable way to change the value of this field through Flow.

Besides, please consider submit this as an idea in the Microsoft Flow idea forum, so it might be considered for future releases.

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Administrator
Administrator

Re: Microsoft Flow - Impersonate User while uploading file to sharepoint

Hey, @namit_gupta!

Thank you for posting on the Flow Community Forum! It appears as though @v-bacao-msft would like some more information in order to further assist you properly with your issue. Please share any additional information that was requested in order to decrease the amount of time that it will take for you to be assisted!

Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

-Gabriel
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (7,443)