cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Re: PowerApps People picker - Current User

Have you tried removing the OnChange code and seeing if you still get the error? If you don't get an error then that would mean the OnStart manager code is working and maybe the issue is with getting the value from DataCardValue35 in the OnChange property. 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Brice235i
Level 8

Re: PowerApps People picker - Current User

Yes, unfortunately I removed and I still get the error....  I removed all code though and still the error, even after removing the Onstart function.  I think there is something buggy with caching.  I removed the connection as well, but when I look at the connections being used it still says this app is using the O365 connector.

Think it's time to have a break..  it is very confusing.  The error I receive, I see it is a known issue...  I will look at the various posts to see if there is some workaround e.g. this one: https://powerusers.microsoft.com/t5/General-Discussion/The-service-returned-an-error-Office365Users-...

Brice235i
Level 8

Re: PowerApps People picker - Current User

@Jeff_Thorpe thanks, the error was with the onchange formula.  Also, there was a caching issues going on in Chrome.  I ended up logging out of Chrome and using Edge.  I managed to delete the connections successfully as you suggested and I removed the onchange formula..  Funny though, in preview it works sometimes...   The idea is that the requestor can submit on behalf of someone else.  When they change the name of the person in the requestor field the manager updates to reflect.

 

Also interesting that in Chrome no error  was displayed in edit mode against the datacardvalue, but in Edge an error displays straight away!  

 

Don't suppose you have any idea why this formula is in error?  I can raise a separate post if you prefer.  thank you so much for your help.

Set(gvCurrentManager, Office365Users.ManagerV2(DataCardValue35.Selected.Email))

 

 

Anonymous
Not applicable

Re: PowerApps People picker - Current User

In My scenario

On a sharepoint list i have two columns

Title= Products

Owner=People picker multiselect. 

There are couple of products that has multiple owners whith people picker multiselect option.

I'm trying to get product information into powerapps and based on product we select a textbox should populate with owner information.

Did you try for any workaround. Please let me know.

Thanks

Brice235i
Level 8

Re: PowerApps People picker - Current User

Hi Jeff, yes after some confusing caching issues... and a switch from Chrome to edge to force the connection refresh, I determined the error is with the DataCardValue35 in the OnChange property. 

It is good enough for now.  If someone submits on behalf of someone else they just have to overwrite the manager field manually.

Is a shame I can't get it working, but will do for now.   Was really strange as the formula worked in Chrome in preview and the app play properly in the browser in Chrome, but the connection error appeared in the mobile app... and in Edge the error is flagged on DataCardValue35 in edit mode.

Thanks for your help, if you do happen to know how to fix the onChange so that when the requestor field is changed, the manager field automatically updates to this person, that'd be great.  When I get time, I will do some more experimenting.

 

erroneous formula that causes connection error - onChange datacardvalue35

Set(gvCurrentManager, Office365Users.ManagerV2(DataCardValue35.Selected.Email))

 

thanks Jeff.

Brice235i
Level 8

Re: PowerApps People picker - Current User

Hello, sorry I am a beginner...  I don't know how to do that.  Best you create a new post 🙂

Anonymous
Not applicable

Re: PowerApps People picker - Current User

Hi Jeff,

Can you help me with how top delete a power users community account. I'm unable to find an option to delete my account. i accidently created two and don't want to use both.

 

Thanks in advance.

 

Brice235i
Level 8

Re: PowerApps People picker - Current User

Thanks Jeff, it took me a while to figure it out.  Got there in the end.

 

Initial onChange formula that caused error:
Set(gvCurrentManager, Office365Users.ManagerV2(DatacardValue5.Selected.Email)

 

Corrected onChange Formula:
If(Len(DataCardValue5.Selected.Email)>0, Set(gvCurrentManager, Office365Users.ManagerV2(DataCardValue5.Selected.Email));Set(varManager, gvCurrentManager))

 

(DataCardValue5 = Requestor field)

 

Thanks for your help

@Jeff_Thorpe

Rociog
Level: Powered On

Re: PowerApps People picker - Current User

This worked for me with a couple of adjustments in the form name and ThisItem.Columnname. Thank you!

Highlighted
Super User
Super User

Re: PowerApps People picker - Current User

Not sure if this has changed since it was first posted, but using User() with no . descriptor in the DefaultSelectedItems now works for the current user name in a people picker field.  I think this answers the original question.

 

If(EditForm2.Mode = New,User(),Blank())

Works the same as the other solution, but you dont need all the stuff in the squigglies.

View solution in original post

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Kudoed Authors
Users Online
Currently online: 270 members 5,447 guests
Please welcome our newest community members: