cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stormin_30
Helper I
Helper I

SharePoint remove user

Hello All,

 

I am trying to add and remove users to a SharePoint site using the "Send an HTTP request to SharePoint" action. The add action works but the removal does not.

 

Any ideas where I am going wrong?

stormin_30_0-1602972537420.pngstormin_30_1-1602972578698.png

Error message: The expression "web/SiteGroups(https:/normyoung.sharepoint.com/sites/SharePointDemo/_api/Web/SiteGroups/GetById(5))/users/removeByLoginName" is not valid.
clientRequestId: b2bf9405-1b0c-438e-80a5-c8d575776e18
serviceRequestId: a5ac849f-b04d-b000-cc44-463d26a3000d

Thanks.

 

Norm

 

1 ACCEPTED SOLUTION

Accepted Solutions
stormin_30
Helper I
Helper I

Solution:

 

Get user ID

stormin_30_0-1603022558560.png

 

Compose user ID

stormin_30_1-1603022651221.png

@{body('Send_an_HTTP_request_to_SharePoint_-_Get_User_Id')['d']['id']}

 

Remove user

stormin_30_2-1603022680013.png

 

 

View solution in original post

3 REPLIES 3
ChrisPiasecki
Super User
Super User

Hi @stormin_30,

Try adding the user login into the request string as such. 

..../removeByLoginName(@v)?@v='<USER CLAIMS>'  

https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-rest-reference/dn5314...

---

Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

Hi @ChrisPiasecki, thank you for the suggestion, I appreciate it. I was not able to get "removeByLoginName" to work and went with "removeById".

 

It's working now and I will post the solution to help others.

 

Norm

stormin_30
Helper I
Helper I

Solution:

 

Get user ID

stormin_30_0-1603022558560.png

 

Compose user ID

stormin_30_1-1603022651221.png

@{body('Send_an_HTTP_request_to_SharePoint_-_Get_User_Id')['d']['id']}

 

Remove user

stormin_30_2-1603022680013.png

 

 

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,855)