I have created a Flow from the default template of "Copy files between OneDrive for Business and SharePoint" and added a step to send a notification email that contains the following;
New item [DisplayName] is located at [Path] and was created [LastModified]
You can access the file at "{SharePoint teamsite URL typed out}[File name]"
Where items in square brackets are selected from Dynamic Content. This works perfectly. Each time a person uploads a file to a selected folder in OneDrive for Business, the file is copied to the correct SharePoint teamsite repository, and an email is sent.
I have two questions;
a) I would like the notification email to report which user created / uploaded the file in O4B - I can see the name of the user against the file name in OneDrive for Business, and I would like the notification to report who uploaded the file. What Dynamic Content variable or Formula can I use for this?
For example, the OneDrive for Business folder is shared with JohnSmith@company.com, and they create/upload a file that shows the owner or the file as "John Smith" - how can I get either of these usernames?
b) The file is created in SharePoint with the "Created By" owner as me (the creator of the Flow). Is there a way for the Flow to impersonate the user to record the username of the OneDrive for Business user in the SharePoint teamsite? i.e. If John Smith uploads a file to OneDrive, show John Smith as the file creator in SharePoint.
Question A is the one I am most focussed on, question B is a value-add.
Thanks