Skip to main content

Notifications

Power Automate - General Discussion
Suggested answer

SharePoint Connector GetItems and multi-select Choice columns

Posted on by 16
My org has a list in SharePoint the contains one column that is of type Choice, with the "Checkboxes (allow multiple selections)" option.
 
I'm using GetItems from the SharePoint connector in an online PowerAutomate flow to try to pull values from this SharePoint list, and export it as a pipe-delimited CSV.
 
But the connector does not seem to be able to pull the selected values from this Choice/Checkbox column.
 
GetItems is set up to pull all active items
 
 
And then I have a Create CSV Table action, that has custom columns (required different header values). The "Channels" column is the multi-select Choice column in the SharePoint list.
If I pick the column from the Dynamic Content picker (as "Channels Value"), the value of the column just reverts to "item()?['Value']", and returns a null value when the flow is run.
 
Create CSV settings
If I try to hardcode "item()?['Channels']?['Value']", the flow fails with "The template language expression 'item()?['Channels']?['Value']' cannot be evaluated because property 'Value' cannot be selected."
How can I retrieve the value of this Choice column that could have multiple values selected?
 
TIA
Categories:
  • Suggested answer
    Expiscornovus Profile Picture
    Expiscornovus 29,909 on at
    SharePoint Connector GetItems and multi-select Choice columns
    You can use xml and xpath for this.
     
    Grantjenkins has shared a nice approach for this with several examples:
     
    I also shared a similar example on StackOverflow:
     
    Below is an example for your setup
     

    1.Convert the Outputs to XML in a Compose before your Create CSV

    xml(json(concat('{"root": { value:', outputs('Get_items')?['body/value'], '}}')))
    

    2.Use the below in the From of the Create CSV action instead of the value field:

    xpath(outputs('XML'), '//root/value')
    

    3.Use the below to retrieve the values of the choice and join them back together as a comma separated string value
    You might need to double check if that field name is the same after the XML conversion though

    join(xpath(item(), '//Channels/Value/text()'), ', ')

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,719

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard

Featured topics