cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gasilva8
Helper II
Helper II

Add user to SharePoint group

I'm working on a flow with PowerApps trigger, so I get users email to add that person to a SharePoint Group.

Below is my flow.  I'm trying to use "Claims" information. So basically I'm extracting the part before the @ from users email and concatenating to "@organization.onmicrosoft.com" to use on the last step.

gasilva8_1-1656600666730.png

On the last step I'm using these parameters:

gasilva8_0-1656600116002.png

But I'm getting this "InternalServerError", and the flow keeps trying to run this but without success.

gasilva8_3-1656601144300.png

What I'm doing wrong?

Thank you!!

 

3 REPLIES 3
eliotcole
Super User
Super User

Hi, @gasilva8 ... try this ... take off the ;odata=verbose part from the Content Type ... if it still fails, put it back, and try it on the Accept ... but it's usually Content Type, I think.

 

Often times you can also try looking at any ID values that you might be using in the URI here, try ensuring that they're uriEncoded(). However that's not an issue for you as you're not.

 

The SharePoint and Graph APIs can be finickity about this at times, sometimes accepting them fine, and sometimes needing the encoding. I think if you just always encode, though, it usually works.

Hi @eliotcole!

I tried to take off the odata=verbose part but it didn't work.

Could you please explain more about uriEncoded()? Where should I use it?

 

eliotcole
Super User
Super User

It's not needed on your URI, @gasilva8, so you're currently OK there.

 

Why don't you just use one of the users / groups actions in Power Automate?

 

Or is this for an old SharePoint group, not a 365 group?

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,598)