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

Correct Creator or Author sharpoint item list

Good morning everyone,

I created a flow with MS Form that allows you to collect data and insert it in a sharepoint item list.

 

AndreaWest83_1-1653343160448.png

Unfortunately, however, all the elements created in sharepoint have the creator of the stream as author, thus not allowing the filter by author or the view elements only by the creator.

How can I fix the flow to show the correct author name?

 

Thanks,

Best Regards,

Andrea

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Dual Super User
Dual Super User

Hi @AndreaWest83,

 

You could introduce a new person or group type of column for this and map to the responder's email to that field in the create item action.

 

Alternatively, you can also use an Send an HTTP request action with the validateUpdateListItem method of the REST API to update the item after it has been created and correct the Author field value to what you want.

 

@tom_riha has written a nice blogpost about this second approach:

https://tomriha.com/how-to-change-sharepoint-item-author-created-by-with-power-automate/

 

 

View solution in original post

7 REPLIES 7
Expiscornovus
Dual Super User
Dual Super User

Hi @AndreaWest83,

 

You could introduce a new person or group type of column for this and map to the responder's email to that field in the create item action.

 

Alternatively, you can also use an Send an HTTP request action with the validateUpdateListItem method of the REST API to update the item after it has been created and correct the Author field value to what you want.

 

@tom_riha has written a nice blogpost about this second approach:

https://tomriha.com/how-to-change-sharepoint-item-author-created-by-with-power-automate/

 

 

AndreaWest83
Regular Visitor

Hi @Expiscornovus

 

Thanks for the quick reply.

I tried the flow, but I get the error 401 UNAUTHORIZED.
But my account is the same one that creates the object in sharepoint.

How is it possible?

 

{
    "statusCode": 401,
    "headers": {
        "Pragma": "no-cache",
        "x-ms-request-id": "f85340a0-60fc-4000-340f-5b42d710f065",
        "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
        "X-Content-Type-Options": "nosniff",
        "X-Frame-Options": "DENY",
        "Cache-Control": "no-store, no-cache",
        "Set-Cookie": "ARRAffinity=f5590XXXX;Path=/;HttpOnly;Secure;Domain=sharepointonline-we.XX.net,ARRAffinitySameSite=XXX;Path=/;HttpOnly;SameSite=None;Secure;Domain=sharepointonline-we.XXXXXt",
        "Timing-Allow-Origin": "*",
        "x-ms-apihub-cached-response": "true",
        "x-ms-apihub-obo": "true",
        "Date": "Mon, 23 May 2022 22:38:51 GMT",
        "Content-Length": "337",
        "Content-Type": "application/json",
        "Expires": "-1"
    },
    "body": {
        "status": 401,
        "message": "401 UNAUTHORIZED\r\nclientRequestId: 77XXX08c\r\nserviceRequestId: f8XXXXX5",
        "source": "https://rXXXXXXX.sharepoint.com/sites/Agent/pi/web/lists/GetByTitle('Control')/items(115)/validateUpdateListItem",
        "errors": []
    }
}

 

Hi @Expiscornovus,

 

I'm sorry I wrote the link wrong, I wrote the link wrong:

_api/web/lists/GetByTitle(

 

Now everything works, but I don't change the author column.

 

The output I get this error:

 

"ErrorMessage": "Organization policies do not allow sharing with these users. Go to External Sharing in the Office 365 Admin Center to enable it.",

 

Expiscornovus
Dual Super User
Dual Super User

Hi @AndreaWest83,

 

Can you share a screenshot of the configuration of your Send an HTTP request action? This way we can check if something is not missing in there.

 

The error suggests you might be using a guest account for the author value? Is that correct, can you check that as well?

 

 

Hi @Expiscornovus,

 

 

This is the flow for the author change:

 

Immagine 2022-06-10 095202.png

 

Thanks,

Regards,

Andrea

 

Expiscornovus
Dual Super User
Dual Super User

Hi @AndreaWest83,


I see in the screenshot the FieldValue is:

 

[{'Key':'i:0#.f|membership|<autore email>'}]

 

 

Can you try it without the < & > characters?

 

[{'Key':'i:0#.f|membership|autore email'}]

 

 

And can you also check the flow history if the email which is used is of an employee (internal) or of a guest user (external)?

Hi @Expiscornovus,

 

I solved.

Thanks for the support I had copied badly 🙂

 

Andrea

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (1,169)