Forum Discussion
SharePoint List from Excel, but the Choice Column will not populate
Newbie here. I have an Excel spreadsheet that I am using to add values to a SharePoint List. The Power Automate flow is simple.
It is part of the SharePoint Online site, so it looks like this:
The COMPOSE value is this:
{
"Value": @{split(items('Apply_to_each')?['Streams'], ',')}
}
Below is the run results code. You can see the values are set correctly:
{
"host": {
"connectionReferenceName": "shared_sharepointonline",
"operationId": "PostItem"
},
"parameters": {
"dataset": "{Name of SharePoint Site}",
"table": "b81509cf-8848-47e9-ad2c-e0eb3aba4c94",
"item/Title": "90 Day - Plan of Care Discussion",
"item/field_1": "To document the required discussions when developing the Plan of Care",
"item/field_2": null,
"item/Streams": {
"value": [
"Child",
"Youth"
]
},
"item/field_3": "x",
"item/field_4": "x",
"item/field_5": "",
"item/field_6": "",
"item/field_7": "",
"item/field_8": "",
"item/field_9": "",
"item/field_10": "",
"item/field_11": "",
"item/field_12": "",
"item/field_13": "",
"item/{ContentType}/Id": "0x01003F1154662236A14DA987CE0BE8192F1A"
}
}
All fields populate except the Streams field, the only field that does not populate. What am I missing?
Any help would be appreciated.
Thank you for this. I found my issue. I was trying to create items from a lookup list. I changed the code to look up the values and add them as IDs, not as split values. Here is how I fixed it:
- Added an Initialize variable and an array at the beginning.
- In the Apply to each, I added a Set variable to null.
- Added an Apply to Each under the Compose (named Append to Array) to create the array value.
- Added Get Item for the list lookup with Title equal to the Append to Array values, Top 1 count only, as the list is unique.
- Added another Apply to each (For Each) (Body/Value from Get Item)
- In the Append to Array action, I create the values
{
"Id": @{first(outputs('Get_items')?['body/value'])?['ID']}
}
- The two Apply to Each loops close, then I Create the Item.
3 Replies
- Sandra TibbsTin Contributor
Thank you for this. I found my issue. I was trying to create items from a lookup list. I changed the code to look up the values and add them as IDs, not as split values. Here is how I fixed it:
- Added an Initialize variable and an array at the beginning.
- In the Apply to each, I added a Set variable to null.
- Added an Apply to Each under the Compose (named Append to Array) to create the array value.
- Added Get Item for the list lookup with Title equal to the Append to Array values, Top 1 count only, as the list is unique.
- Added another Apply to each (For Each) (Body/Value from Get Item)
- In the Append to Array action, I create the values
{
"Id": @{first(outputs('Get_items')?['body/value'])?['ID']}
}
- The two Apply to Each loops close, then I Create the Item.
- SynthiaHongIron Contributor
One thing to check is how the Choice column is formatted in SharePoint. When importing from Excel, the values don't always map automatically to SharePoint Choice fields. Make sure the column options in SharePoint match the values in your Excel sheet, and check for extra spaces or spelling differences. You may need to populate the Choice column separately after importing the list.
- Michelle_Scott77Brass Contributor
The choices are present, but their structure is wrong. Your flow sends one object containing an array. For the SharePoint connector’s multi-select Choice field, use an array of objects, with one Value per choice:
[
{ "Value": "Child" },
{ "Value": "Youth" }
]First, check the Streams column in SharePoint and confirm “Allow multiple selections” is enabled.
Then replace Compose with a Data Operations → Select action inside your existing Apply to each:
- In From, use this expression:
split(items('Apply_to_each')?['Streams'], ',')
- In the mapping, enter Value as the key. For its value, use the expression:
trim(item())
This also removes spaces from entries such as Child, Youth. - In Create item, find Streams and choose Switch to input entire array if that option is shown. Insert the Output of Select directly into that field. Don’t wrap it in another Value object.
Make sure Child and Youth match the choices configured in SharePoint. Test with one Excel row first, then check the Create item inputs: Streams should contain the array shown above.
If Streams is a single-select Choice column, it must receive just one choice instead—you cannot put both values into it without enabling multiple selections.
- In From, use this expression: