Forum Discussion

ulmoshare's avatar
ulmoshare
Brass Contributor
Nov 21, 2022

Set User Profile Value via Microsoft Forms

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?

  • 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

    • ulmoshare's avatar
      ulmoshare
      Brass Contributor
      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

         

Resources