web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Extract Value from cho...
Power Automate
Unanswered

Extract Value from choice column as text if input format is in JSON

(0) ShareShare
ReportReport
Posted on by 25

I have created a flow which takes input table values in JSON format and creates a csv table where I have used custom columns with values. I have defined the header and value for all my custom columns. For columns whose value is defined as single line of text I had no issues showing them in my csv table but when comes to choice columns (single select) the output in csv table shown is {value : "ABC"}, here I just need the value i.e. "ABC". So after going through several blogs I got an expression

join(xpath(xml(json(concat('{"body":{"value":', item()?['COLUMN NAME'] , '}}'))), '/body/value/Value/text()'), ', ')

this expression I have added in Value of my choice columns and it works fine I just get the value i.e. "ABC" in my csv table. My problem is that the flow fails to run and gives an error:
The execution of template action 'Create_CSV_table' failed. The column values could not be evaluated: 'The template language function 'json' parameter is not valid. The provided value '{"body":{"value":}}' cannot be parsed: 'Unexpected character encountered while parsing value: }. Path 'body.value', line 1, position 17.' and this happens when there are null or blank values in my custom columns.

How can I rectify the expression to make the flow run correctly?

Categories:
I have the same question (0)
  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at
    Re: Extract Value from choice column as text if input format is in JSON

    If your Choice columns are single select (as you mentioned) the you just need to use the Value property as shown below.

     

    grantjenkins_0-1699308869640.png

  • DGDGDGFHF Profile Picture
    25 on at
    Re: Extract Value from choice column as text if input format is in JSON

    thank you @grantjenkins 😊

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard