
Announcements
We are wanting to use the REST API to add a new value to a choice column, but also have it added alphabetically...not just to the bottom.
So far, when I'm reading is you can't just "Add" a field, you have to grab all the values in an array, then update that array option, then re-populate the choice column...am I off?
If the above is correct, how would I go about it? I'm stuck on #3 step to push the new array back to the column so the new choice is visible.
1. Put current field values in array (seems pretty easy in FLOW with a REST API call
https://sitecollectionurl/_api/web/lists/getByTitle('ListName')/fields/getbytitle('ChoiceField')
2. Append new value to existing array variable (seems pretty easy in FLOW)
Use Append to String (of type Array) action
3. Call REST API to push values to column via POST:
{
"__metadata": { "type": "SP.FieldChoice" },
"Choices": { "__metadata": { "type": "Collection(Edm.String)" },
"results": OUTPUT from PowerAutomate Action }
}
4. Seems like once the #3 POST is done, I can call the collection again with a GET sort, push that to the array, then re-POST to the column to sort the values...not just append to the end.
Hi,
When I try this I get an error The parameter __metadata does not exist in method GetByTitle.
Do you maybe know how to get around that?