cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Modifying Created By on SharePoint List with Power Automate

Hello,

 

I have a flow connecting a Microsoft Form to a SharePoint List.  Now every time a form is submitted (trigger) and the flow runs, I end up being the creator of the request under "Created By" on SharePoint, as I am the creator of the flow. What I need is the "Created By" field to be updated with the Form Submitter's name/account instead of mine. This would allow me to enable Item-Level Permissions on SharePoint and every Form Submitter would only be able to see or edit his/her own record on the list.

 

SharePoint1.PNG

 

I found the link below while searching, but as I'm not a developer, could anyone explain the steps to me, and if this would work?
If not is there an alternative solution?

 

http://johnliu.net/blog/2019/2/flowninja-hack-78-modifying-modified-by-and-modified-time-with-micros...

 

Thank you!

26 REPLIES 26
lukasz2
Helper I
Helper I

Hi,

 

I am trying to use this solution. in conjunction with item-level permissions. I was able to recreate this flow and it works at first glance.
so it change author and editor to form responder

this is my output:

 

API call.png

 

but unfortunately this user still does not see this item when I have item level permission enabled.
so ive done some research and seems like some values were changed

I checked the element link  before and after request  - ....._api/web/lists/getbytitle('MyFancyListName')/items(44)

I can't find the "Author" and "editor" values ​​there but I see there is "AuthorId" and "EditorId" and it looks like my request is changing these values. because when I'm not doing the request, it's 11 and if request is performed it is changed into 10 and i know that it is correct user ID because I also have form responder in one column and it's actually 10.

Bez tytułu.png



but I don't know why it doesn't work and the user doesn't see these items. It doesn't seem to work. Can anyone confirm that this method still works?

Hi @lukasz2 

Please don't append new comments or replies to the closed solution. Start a new thread pointing out this solution if it doesn't work. 

 

Make sure you change the item level permission first and update the Author or Editor values.

 

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

Hi @Anonymous I typed in 

body('Get_response_details')?['responder']

 

But get an error: "Führen Sie eine Korrektur durch, um einen gültigen Verweis auf "Get_response_details" für die Eingabeparameter der Aktion "Ersteller_extrahieren" einzuschließen."

Translation: Make a correction to include a valid reference to "Get_response_details" for the input parameters of the "Creator_extract" action.

 

What am I doing wrong? I do this with German localization. Could that be the reason?

Anonymous
Not applicable

Hi @MichaelGSP,

 

You will need to share your flow (screenshot main steps and code you are inserting), otherwise I won't be able to understand the context.

 

 

Thank you, 

Thank you @Anonymous 

 

I fixed one problem, by adding the ID to the URI. Thanks for that help in your former post. You find the flow in the picture. Now, I get the following

 

{
"status": 400,
"message": "Beim Lesen aus dem JSON-Reader wurde ein unerwarteter StartArray-Knoten gefunden. Ein PrimitiveValue-Knoten wurde erwartet.\r\nclientRequestId: xxx-81ff-4eb9-b024-xxx\r\nserviceRequestId: xxx-f085-3000-69f0-xxx",
"source": "https://xxx.sharepoint.com/sites/P-Verschwiegenheitserklrung2/_api/web/lists/getbytitle('Verschwiegenheitserkl%C3%A4rung%20-%20Ablage')/items(13)/validateUpdateListItem",
"errors": [
"-1",
"Microsoft.Data.OData.ODataException"
]
}

 

Bildschirmfoto 2021-10-25 um 20.43.58.png

Anonymous
Not applicable

@MichaelGSP, sorry for the late reply, I just noticed that.

If you are still having this issue, I believe the problem lies in having an array instead of a string value.

Here's how I resolved it:

alberto1_0-1635802344197.png

Compose user 2 uses the outputs from GetResponder 2 (the step before).  The expression in Created By would be the below, and don't forget to put it between quotes "":

string(outputs('Compose_User_2'))

Let me know if this helps.

it worked!! Thank you a lot

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,674)