0

When a folder is created in a library I would like the Name of the folder to populate a choice field. I would like to use REST in Power Automate to add a choice to a choice column with write-in enabled but it overwrites the other choices. Can I get the current choices as an array then add them to the item I am wanting to update? I am not sure how to go about this. The following is an example of my code:

`{ "__metadata":
{
"type": "SP.FieldChoice" },
"Choices": { "__metadata":
{ "type": "Collection(Edm.String)" }, "results": NewChoiceOption #How can I add the current choices here so that I don't overwrite?

}
}

`

0

You could take the following steps:

  1. Initialize 2 variables, one type is array and one type is string.
  2. Use rest api to get the choice field.
  3. Parse the JSON "Body", you would get the current choices as array "results"
  4. Set the array variable to "results", then append one value to the array varibale.
  5. Set the string varibale to the arrary variable.
  6. Update the choice field.

enter image description here

enter image description here

enter image description here

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.