Published on

Update User Profile Using Power Automate and Forms

Authors
  1. Create a form under https://forms.office.com/Pages/DesignPageV2.aspx

  2. Add the field or the fields you want to update in the form, Im going to update about me field

Image
  1. Save the form

  2. Create a new flow under Power automate, this will be an automated flow https://make.powerautomate.com/

  3. Select: "When a new response is submitted" as the trigger

  4. Image
  5. Add a new step and select: "Get Response Details"

  6. Image
  7. Image

Single value Property

| Name         | Value                                                              |
| ------------ | ------------------------------------------------------------------ |
| Site Address | https://yourTenant.sharepoint.com/sites/yourSite                   |
| Method       | POST                                                               |
| Uri          | /\_api/SP.UserProfiles.PeopleManager/SetSingleValueProfileProperty |
| Headers      | Accept: application/json; odata=nometadata                         |
| Headers      | content-type: application/json; odata=nometadata                   |
| Body         |
{
  "accountName": "i:0#.f|membership|UsersEmailFromForm",
  "propertyName": "AboutMe",
  "propertyValue": "YourFieldFromForms"
}

Multi value Property

| 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         |                                                                    |
{
  "accountName": "i:0#.f|membership|UsersEmailFromForm",
  "propertyName": "OnePiece",
  "propertyValue": ["Luffy", "Zoro", "Nami", "Usopp", "Robin"]
}
  1. Image
  2. Image