cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Venomtver
Advocate I
Advocate I

Replace choice value in all items

Recent case: Leadership decided to change the name of their store from “Zara” to “Lara” 

Task: Change all the values in SharePoint list from “Zara” to “Lara”. 

In Single-Value columns we can easily do it manually. Same approach for Multiple Values columns would be annoying. 

Here comes Power Automate with the following logic: 

Create empty Array. For each Choice Value in item, If “Z” found, replace to “L”. Append Value to array. 

When all values are taken, update the item with a new array. Repeat cycle. 

 

Flow provided below triggered manually. 

Whole picture - Copy.PNG

  

Expanded.PNG

  

 

Steps: 

  1. Clear the Array before the cycle starts. Otherwise, old values will be stored. 
  2. Create “Apply to each” Manually. While choosing column with “multiple choice”, system creates 2nd loop “Apply to each 2” and put the Values. 
  3. Create Compose, put there items(‘Apply_to_each_2’) with @OData.type ,Id, Value. 
  4. Create New Compose, where we put Value. 
  5. Replace text (“Z” to “L”). 
  6. Append to Array. 
  7. Because our Array has such type as ["L"], we should convert it to [ { Value: "L"} ]. “Select” block helps us with this operation. 
  8. In “Update item” click on “Switch to input entire array”, to put whole array. 

To be developed: 

  1. Simple flow, without value validation. If we have “Zebra”, it will be replaced with “Lebra”. 
  2. Don't forget to Add new Value into choice list.
  3. To spare some time and resources, we may add Filter Query: substringof('Zara', Store)
  4. Real column name may be different. To define it for sure, open column settings and drag column name after &Field=. 

My comment: Spend 2-3 days on creating this flow, didn't find similar cases, so decided to post my solution. Hope it helps someone.

I case of any questions, contact me via mail: venomtver@mail.ru

Relevant links: 
https://spknowledge.com/2020/09/04/update-multichoice-field-using-power-automate/

https://sharepains.com/2019/04/01/update-a-multi-select-choice-power-automate/

https://365basics.com/microsoft-flow-populate-a-multi-choice-field-in-sharepoint/

0 REPLIES 0

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (5,823)