I am trying to auto-populate 4 user fields (JobTitle, Department, Office, Location) in a SharePoint list form using Power Apps.
I opened the SharePoint form from Power Apps to customize it. I connected to the Office365Users connector. The connector has my name/email on it.
I set each user field's card Default properties to:
Office365Users.UserProfileV2(DataCardValue2.Selected.Email).officeLocation ("officeLocation" or whatever field I want to auto-populate) ("DataCardValue2" is the People Picker Control in the SharePoint list)
When I select myself as the user, all 4 fields (JobTitle, Department, Office, Location) auto-populate perfectly, in testing as well as after the form has been published back to SharePoint.
However, if I select any other users, auto-populating is failing and I get the following error:
Office354Users.UserProfileV2 failed: {"error": {"code": "Authorization_RequestDenied", "message": "Insufficient privileges to complete the operation.", "innerError": {"date": "2022-08-08T21:00:57", "request-id": "092ff1db-94ac-43dd-b30a-a8b41077b2cc", "client-request-id": "092ff1db-94ac-43dd-b30a-a8b41077b2cc"}}}
I had heard that using UserProfileV2 didn't require heightened permissions since it was only accessing a read-only copy of the data (and not writing anything).
I tried deleting the Office365Users connector and reconnecting it and still no luck. I'm new to Power Apps and hopefully this is an easy fix. Thanks.