cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PaulT
Frequent Visitor

Issue sharing a PowerApp with a guest user

I am designing a PowerApp to be used with some external users. It will be used to allow them to fill out a form which sends data back to a SharePoint list.

I created the app, created some guest users in my tenant and I am successful in having them write back to the SharePoint list. I am now trying to only show them the list items that they are responsible for by filtering using email addresses. If I use a regular (non-guest) account then everything works just fine. I use the Office365Users connection to retrieve the email address of the current user.

When I try it with a guest users I get an error that access is denied to the Office365Users connector.

I have assigned the external users full Office licenses (for testing) and they can access the SharePoint lists but it's just the Office365 connector.

Can anybody tell me what I am doing wrong?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @PaulT , 

The reason why Office365Users.MyProfile().Mail works, but  Office365Users.MyProfileV2().Mail not works is that the result of these two functions are different.

You need to use:

Office365Users.MyProfileV2().mail

1)The result of  Office365Users.MyProfile():

519006.PNG

 //The email column named Mail.

 

2)The result of  Office365Users.MyProfileV2():

519005.PNG

 

//The email column named mail.

 

 

Please read this doc about this connector in details:

https://docs.microsoft.com/en-us/connectors/office365users/#user

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-yutliu-msft
Community Support
Community Support

Hi @PaulT ,

Do you want to share an app connected with office365 users to external user?
I've made a similar test but not met the same problem like your description.

However, since you are an external user, you need to switch account when asking for permission of office365 users.

Switch to your external account.

5130.PNG

 

 Then choose your external account for multiple times.

Wait for a minute, the user email will show.

The formula that I use to show email:

Office365Users.MyProfile().Mail

 

 

What's more, if you still has problems, you do not need to use office365 users connector to get current user's email.

This formula is enough:

User().Email

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you for your reply.

The problem with User().Email is it does not necessarily give the user's email address but it actually gives the user's UPN. Normally this might not be a problem but with guest accounts the UPN shows as "live#useremail@outlook.com".

Since we are creating the accounts this will always be the way it shows up (I hope) so I will just work to strip out the "live#" portion of the UPN and try using that.

Hi @PaulT ,

I do not mean that you set user's email when designing the app.

You could only make user switch to his account when he is running this app.

And the permission could only be allowed when he is running this app.

It can not be set in advance.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @PaulT ,

Actually, this license should be enough.

This error message should be about permission.

Please check whether you give the guest user the permission of viewing azure profile.

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

So I don't think it is a permissions issue. I switched to using Office365Users.MyProfile().Mail (instead of Office365Users.MyProfileV2().Mail and now things are working properly. 

I don't know if this is by design or a bug but it looks like MyProfileV2 doesn't work with the guest user accounts. 

Hi @PaulT , 

The reason why Office365Users.MyProfile().Mail works, but  Office365Users.MyProfileV2().Mail not works is that the result of these two functions are different.

You need to use:

Office365Users.MyProfileV2().mail

1)The result of  Office365Users.MyProfile():

519006.PNG

 //The email column named Mail.

 

2)The result of  Office365Users.MyProfileV2():

519005.PNG

 

//The email column named mail.

 

 

Please read this doc about this connector in details:

https://docs.microsoft.com/en-us/connectors/office365users/#user

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Users online (37,416)