web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Modified by field in S...
Power Automate
Answered

Modified by field in Sharepoint needs to be updated with from adress used in the email

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I have created a flow in such a way that when new email is sent to a shared mailbox, all the attachments along with body of email as an .eml file  will be added to Sharepoint library inside a folder, which will created based on the subject of the email. Folder name will be the subject of the email which is sent. 

I was able to create it successfully but the modified by column displays my name as am the owner of the flow. But it should be someone who sends the email to the shared mailbox. Can someone kindly help me with this?

 

Note: Files are getting uploaded inside a folder and that folder is being created in the name of the subject added in email for every run.

 

Regards,

Sushmita.

 

 

Categories:
  • Ellis Karim Profile Picture
    12,381 Super User 2026 Season 2 on at

    Hi @Anonymous ,

     

    After the file has been saved your Sharepoint library  you can then update the Modified By column by calling an API using the Send an HTTP request to SharePoint action: 

     

    You will need to use the internal name of the Modified By column in the Send an HTTP request to SharePoint action. The internal name is Editor. For more information see: How to find the internal name of a SharePoint column – Ellis Karim's Blog

     

    Snag_83d9a2a.png

    _api/web/lists/GetByTitle('Solution Information')/items(1)/validateUpdateListItem
    
    {
     "formValues": [
     {
     "FieldName": "Editor",
     "FieldValue": "[{'Key':'i:0#.f|membership|AlexW@dev365.com'}]"
     }
     ],
     "bNewDocumentUpdate": true
    }

     

    Snag_83f544e.png

    Hope this helps.


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Ellis,

    Thank you for the response.

    Susmitha0706_0-1662465590647.png

     

    I tried to use the above action and ended up getting errors. My requirement is just to replace the incoming emails setting in Sharepoint onpremises.

    Modified by or created by of all the files in a folder(which is being created with the title in the name of Subject of email) should be updated with name of email sender.

     

    Here in my case Folder and files that include attachments and .eml file are getting created inside a folder that is being created dynamically based on our email Subject.

     

    Could you check the above screenshot and kindly do help me on this.

     

    Regards,

    Susmitha.

  • Ellis Karim Profile Picture
    12,381 Super User 2026 Season 2 on at

    Hi @Anonymous ,

     

    The code snipped I shared above is for SharePoint Online only. What is the exact error message you are getting?

     

    As I understand, your flow performs the following actions:

    1. When new email is sent to a shared mailbox
    2. A folder is created within a SharePoint Library. The name of the folder is the Subject line of the email.
    3. All the attachments are saved to the folder 
    4. The body of email is saved as an .eml file to the same folder
    5. The SharePoint instance is an on-prem installation

    The Problem: When files are created or modified by the flow, the created by and modified by properties are set to the owner of the flow. You want to

    1. change the Created by property of the newly created files to the From address in the email message
    2. change the Modified by property of the modified files to the From address in the email message

    Is this correct?

     

    Here are some things to check:

     

    (1) Check the Uri property for the API. See the following posts:

     

    (2) Please ensure the FieldValue is set as:

    Snag_10153b1b.png

     

     

    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Susmitha95 Profile Picture
    10 on at

    Hi Ellis,

    Thankyou for the clear response!

    I have tried to use the url as mentioned in the above articles. Below is the screenshot.

    Susmitha95_0-1662539499187.png

     

    Error message is "Request is not Valid" Status:400.

    Could you kindly suggest something on this.

     

    Regards,

    Susmitha.

  • Ellis Karim Profile Picture
    12,381 Super User 2026 Season 2 on at

    Hi @Susmitha95 ,

     

    Can you use the following logic to change the author property of the attachments and eml file:

    Snag_15ff644a.png

    Use the following API to change the author or editor:

     

    _api/web/lists/GetByTitle('BDS Archive/FOLDER_NAME')/items(ID)/validateUpdateListItem

     

     Snag_83d9a2a.png

     

    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Susmitha95 Profile Picture
    10 on at

    Hi Ellis,

    I tried to use the URL that was mentioned above. It gives me a different error.

    The list BDS Archive/test Proj sites does not exist on the site whose URL is

    URL that is being used is : _api/web/lists/GetByTitle('BDS Archive/@{variables('Subject Variable')}')/items(@{outputs('Create_file')?['body/ItemId']})/validateUpdateListItem

     

    Susmitha95_0-1662657982810.png

     

     

    Regards,

    Susmitha

  • Verified answer
    Ellis Karim Profile Picture
    12,381 Super User 2026 Season 2 on at

    Hi @Susmitha95 ,

     

    I had a chance to create a working demo flow as shown below:

     

    Snag_1ad916cd.png

    These are the steps in my flow:

     

    Snag_1ad4a8b5.png

    Create a folder based on the emails Subject line:

    Snag_1ad537b6.png

    (You can change the Created by and Modified by properties of the folder if needed).

     

    Save all attachments, 

    Snag_1ad69f07.png

    then change Created by and Modified by properties of the file:

    Snag_1ad7a888.png

    Export the email and save to SharePoint:

    Snag_1ada4bd3.png

    then change the Created by and Modified by properties of the eml file:

    Snag_1adb7ffd.png

    This is the sample runtime output

    ekarim2020_0-1662669537301.png

     

    ekarim2020_1-1662669696012.png

     

    Snag_1ae0380f.png

    Hope this helps.

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Susmitha95 Profile Picture
    10 on at

    Hello Ellis,

    Our issue has been resolved. your detailed steps helped a lot. Thanks so much for your support.

    Regards,

    Susmitha

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard