Set User Profile Value via Microsoft Forms

Occasional Contributor

We have created our Sharepoint User Profile Service with its own attribute. Users can change this value using Delve, but using Delve is very cumbersome. We want to create a simple form where the user selects his value and with the help of Power Automate this value should be entered in the User Profile Service. Is it possible to do something like this with Forms and Power Automate?

5 Replies

@ulmoshare 

 

Yes it is! You can do it using Send Http To SharePoint:

 

 

| Name         | Value                                                              |
| ------------ | ------------------------------------------------------------------ |
| Site Address | https://yourTenant.sharepoint.com/sites/yourSite                   |
| Method       | POST                                                               |
| Uri          | /\_api/SP.UserProfiles.PeopleManager/SetMultiValuedProfileProperty |
| Headers      | Accept: application/json; odata=nometadata                         |
| Headers      | content-type: application/json; odata=nometadata                   |
| Body         |                                                                    |
```

```json
{
  "accountName": "i:0#.f|membership|UsersEmailFromForm",
  "propertyName": "OnePiece",
  "propertyValue": ["Luffy", "Zoro", "Nami", "Usopp", "Robin"]
}
```

 

 

I got a blog post from a while back that's step by step :) 

https://yourmodernworkplace.com/blog/update-user-profile-properties-using-flow

Just what I was looking for. Many Thanks.

I still have a problem. In UPS we have attributes that users can edit themselves via Delve. If I want to fill an attribute using this form, Power Automate shows me the error:

This operation requires you to be managing your own data or have administrator privileges.

The form is included on some page and any user can change this value for themselves via Delve, but the error message is misleading as the person is allowed to change it themselves, just not via the form.

@ulmoshare 

 

Run it as an admin, so form runs in user context but the send http runs in admin context :) that should solve it

 

Change%2BConnections

I gave this flow the owner right to a group that contains all users, but it works that way too.
How can I add the group to the connection so that everyone can fill out this form?
Anyone should be able to fill the form, you shouldn't get any errors you have admin connections there. As it will run as admin when sending the http :)