I want to update the current user's info through a form in powerapps. I am able to display the current user's information but, if I change it, it is not updating in the user's profile. What code should I use to do this? This is what I have written in the DataSorce:
Office365Users.UserProfileV2(User().Email, {'$select':"streetAddress"}).streetAddress
Also, how do I edit the user's office phone?
Appreciated
Solved! Go to Solution.
Hi @keylama ,
Do you want to update the current user's info (e.g. Office Phone, streetAddress) within canvas app?
If you want to update the current user's info (e.g. Office Phone, streetAddress) within canvas app using Office365Users connector, I afraid that there is no way to achieve your needs.
Firstly, the Office 365 Users connector is a action data source, which you could not bind it to a Edit form, and use the Edit form to update the user profile info. You could only execute the Office365Users actions within behavior property of control, e.g. OnSelect property of a button.
In addition, the Office365Users.UpdateMyProfile() function in canvas app could only update the following properties:
you could not use the Office365Users.UpdateMyProfile() function to update the officePhone, streetAddress property.
As an alternative solution, I think custom connector could achieve your needs. You could consider create a custom connector based on Microsoft Graph REST API, then specify the "Update user" action within your custom connector. After that, in your app, create a connection to this custom connector, use the custom connector action to update user Profile.
More details about creating a custom connector based on Microsoft Graph REST API, please check the following article:
On your custom connector, you should define the following action path:
More details about creating custom connector in PowerApps, please check the following video or article:
https://www.youtube.com/watch?v=dBCS1nPsDiE&t=2s
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/register-custom-api
Best regards,
Hey @keylama
the "Office 365 Users" Connector only gets user data to show in the app. Check out the docs for further information: Connection Office 365 Userprofile
If you want to update the users information, you can use the "Azure AD" Connector. The Information from your Office 365 Profile / Delve is also based on the Azure AD: Azure AD Update User
I hope this will help you! 🙂
Best Regards
Marvin
If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.
Oh ok, thanks @MarvinBangert !
I read the Azure AD link you provided, but there is no Parameter for Street Address. Any suggestion?
I am about to opt to creating a data base or list with the contact info and ignore User's Data.
Hey @keylama
unfortunately, that are the only parameters you could update within the Azure AD Connector. You could suggest a new idea to update the action to also update contact information like a street address: https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas
Otherwise, you could forward your information to a Microsoft Power Automate Flow and use an HTTP action (premium connector) and update your information using Graph API: https://docs.microsoft.com/en-us/graph/api/user-update?view=graph-rest-1.0&tabs=http
Check out this blog from Serge Luca on how to use a Flow with HTTP action and Graph API: https://sergeluca.wordpress.com/2017/09/22/extend-microsoft-flow-with-the-microsoft-graph-and-0-code...
Instead of using the "GET", you should use the "PATCH" method.
Hope this will help you.
Best regards
Marvin
If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.
I disagree. The Office365Users connection does have some methods that allow for update of the user profile. They are UpdateMyProfile() and UpdateMyProfilePicture(). But they only work for the current user and they don't provide the ability to update the address. Check the reference here:
https://docs.microsoft.com/en-us/connectors/office365users/#update-my-profile
Hi @keylama ,
Do you want to update the current user's info (e.g. Office Phone, streetAddress) within canvas app?
If you want to update the current user's info (e.g. Office Phone, streetAddress) within canvas app using Office365Users connector, I afraid that there is no way to achieve your needs.
Firstly, the Office 365 Users connector is a action data source, which you could not bind it to a Edit form, and use the Edit form to update the user profile info. You could only execute the Office365Users actions within behavior property of control, e.g. OnSelect property of a button.
In addition, the Office365Users.UpdateMyProfile() function in canvas app could only update the following properties:
you could not use the Office365Users.UpdateMyProfile() function to update the officePhone, streetAddress property.
As an alternative solution, I think custom connector could achieve your needs. You could consider create a custom connector based on Microsoft Graph REST API, then specify the "Update user" action within your custom connector. After that, in your app, create a connection to this custom connector, use the custom connector action to update user Profile.
More details about creating a custom connector based on Microsoft Graph REST API, please check the following article:
On your custom connector, you should define the following action path:
More details about creating custom connector in PowerApps, please check the following video or article:
https://www.youtube.com/watch?v=dBCS1nPsDiE&t=2s
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/register-custom-api
Best regards,
User | Count |
---|---|
183 | |
111 | |
88 | |
44 | |
42 |
User | Count |
---|---|
229 | |
110 | |
110 | |
69 | |
68 |