Invite External User to SharePoint

I am getting an Error when running this action on a Modern List Item. 2018-07-06_14-40-09
Error Details On right: Object reference not set to an instance of an object.

Any ideas?

Hello @Jannaj,

Please send me a screenshot of your flow with its properties (on the edit page) via PM.

Thanks for taking a look!

Any ideas? I have tried not using Variables for the required fields, tried the different options: Site, Group (not Item as this will not help me) and I get the same error: “Object reference not set to an instance of an object” Status Code 400

Headers:
Transfer-Encoding
chunked
Connection
keep-alive
CF-RAY
437e4ba9315e28b8-SJC
Date
Mon, 09 Jul 2018 22:41:00 GMT
Set-Cookie
__cfduid=d2bceb39a99a25bc6dd059068089394cc1531176060; expires=Tue, 09-Jul-19 22:41:00 GMT; path=/; domain=.plumsail.com; HttpOnly
Server
cloudflare
X-Powered-By
ASP.NET
Content-Type
application/json; charset=utf-8
Content-Length
96

Hi!

Did you already managed to solve this somehow? I am having this same issue but I am trying to share a SharePoint folder (not list) for an external user. I was wondering if sharing a SharePoint folder is even possible with Plumsail Actions…

Best regards,
Toni Rantanen

Not yet but it sounds like they just fixed something with it so plan to try again in next day or two. To share a folder, what I would do is Invite the user (once it is working), then use the Grant Permissions on SharePoint Item to give them access to the Folder. You could also set up a group and give the group access then add the user to that group. I have had luck getting permissions adjusted at the document level in document libraries.

Hello @tonirantanen,

You can share a SP folder using Get items from a standard Microsoft SP connector:

You should treat folders as items in Invite External User action.

The user that you want to invite should have an active Microsoft account.

Oleg - do you know if it is possible to create a MS account for the end user? Seems like it would be. Anyway - much more elegant than my approach if the Invite works and sends an invitation.

@Jannaj,

You could invite a user, for example, with an email address in Gmail, to your organization in Azure.
When this user accepts the invitation, Microsoft will ask to create an account.

There are actions for Azure in MS Flow to create accounts as well.

Hi Oleg,
I was very happy when I saw your article about sharing the folder itself however when I tried your screenshot I get an “error 400”. It looks like it doesn’t like the ID for some reason but when I run the flow the the Itemid it works. The only problem with that it shares the file that is inside the folder and not the folder itself.
Any idea what I am doing wrong here?
Thanks,
Jarod

Hi @Jarod,

Could you share with me the flow screenshot and the error, so I could advise on the matter?

Best regards,
Petr Bushuev
Plumsail Team

Hi Petr,

Thank you for your reply.
Basically I am creating folders in a document library with a flow initiated from a request form for a sharing approval.
this is what it looks like:
https://boczen-my.sharepoint.com/:i:/g/personal/joe_boczen_co_uk/Ea5KML3HfX5Lp9whTWHknCkBcfa1xjhNaWNKH9gcCvIfjw?e=aeb1n8

And this is the error I’m getting:
https://boczen-my.sharepoint.com/:i:/g/personal/joe_boczen_co_uk/EUz_XO8nZ25Ck9-y75gYizQBhAVwZfmSd6FjAD7L4QOywA?e=wWum4D

Sorry I couldn’t upload the pictures cause I’m new here :slight_smile:

“Relate to Value” is the document library name and the “Title of Sharing” is the folder in the document library. When the form is filled in the flow generates a folder in the Document Library that was selected in the form.

I hope this makes sense.

Thanks for your help!

Jarod

Hi @Jarod,

What if you try to enter a static itemID, let’s say 12 and check how it works?
Also please check the flow output, there should be the itemID value.

Best regards,
Petr Bushuev
Plumsail Team

Thanks Petr for your answer. I will try that.
In the meantime I have created another flow just for the invite and called it with the one that creates the folder from the list. What I have noticed that when the invite action runs it shares literally all the folders inside the document library. I think that’s because I gave the Item ID = ID and not the ID number of the actual Folder. How can I make it dynamic?

Thanks,
Jarod

Hi Petr,
I have used the actual ID number of the folder and it worked. Is there any way it can be used as a dynamic object or at least extract the ID number and use it in the Invite action?
Please let me know if there is a solution for this.
Thanks,

Jarod

Hi @Jarod,

Anyway, each time the flow runs it takes one itemID - and this ID is a static value. Most likely it gets an incorrect ID and failed. Could you track down the received IDs? They should be in the flow statistic when you run it.

Best regards,
Petr Bushuev
Plumsail Team

Hi Petr,

I have noticed that the Invite action wants to take the ID number of the List. I think I will need a function that replaces the List Item ID with the Folder ID. The folder that is generated with the flow in the Document Library ID is different to the List item ID. Alternatively I will have to split the flow into two and when I create a folder from the List I will get the proper ID number.
Can this be done?

Thanks,
Jarod

Hi Petr,

I have managed to do it. I just simply used one of the Plumsail action which is create a folder by URL and I managed to get the right ID for it. I inserted it to the Invite action and voila… eureka :slight_smile:
I have managed to share the folder that was created.

Jarod

1 Like

I am trying to Invite an External User to Sharepoint and getting a "400" and "Object reference not set to an instance of an object." error. I read through tis whole thread but I don't see an answer.

Is there any fix for this?

I saw this comment "The user that you want to invite should have an active Microsoft account." - but that doesn't make any sense. I'm inviting an external user. They are not likely to have an account in my domain, hence the invitation to an external user.

Any advice would be appreciated.

Hello, @johnsaxton

Could you take a screenshot with input and output of the failed action? Please make sure that all necessary data are visible.

Concerning the Microsoft account, it is not required that a user has the account in your domain. An invitation message will contain a link for joining your site. The joining requires the user has an individual (not organisational) Microsoft account. So if he hasn't got one then he will be suggested to create it on the basis of his E-mail address. So in any case, you share the site with the user that has a Microsoft account though the last one is bound with his E-mail in other mail services.