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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Convert table variable...
Copilot Studio
Answered

Convert table variable to a string for Power Automate flow

(1) ShareShare
ReportReport
Posted on by 44

Hi,

 

I have a table from an adaptive card, and I can't seem to concatenate this table to a string so I can send the variable to PA.

 

I tried using the the JSON() formula, but it does not support the table data type.

JSON cannot serialize.png

 

I have tried to concatenate the table to a string, but using Concatenate(Topic.selectedOptionsTable, "") returns an empty string, despite the table having values in it.

 

The adaptive card has the following JSON formula: 

{
  "type": "AdaptiveCard",
  "version": "1.0",
  "body": [
      {
         "type": "Input.ChoiceSet",
         "id": "selectedOptionsTable",
         "isMultiSelect": true,
         "choices": [
            {"title": "Fire Protection", "value": "Fire"},
            {"title": "Drought Protection", "value": "Drought"},
            {"title": "Flood Protection", "value": "Flood"},
            {"title": "Extreme Temperature Protection", "value": "ExTemp"},
            {"title": "Crop Disease Protection", "value": "Crop Disease"},
            {"title": "Crop Pest Protection", "value": "Crop Pest"}
         ],
         "style": "compact"
      }
   ],
   "actions": [
      {
         "type": "Action.Submit",
         "title": "Submit",
         "data": {
            "cardSubmit": true
         }
      }
   ]
}
 
If I send the table variable as a message I can see it is a column table, in square brackets, with the values selected. For example: [“Fire”,“Drought”,“Flood”,“ExTemp”]
 
Am I concatenating this wrong? How can table variables be used?
 
Thanks
Categories:
I have the same question (0)
  • Nina131 Profile Picture
    44 on at

    Hi, 

    I have found a very tedious solution, so if anyone has a better solution, please add it here.

     

    After some trial and error, I have set 6 separate variables named Value1 to Value6. They check if the row count of the table is greater than the current index, and return the field using Index() if true, else "". Then I concatenate the value variables into a string. 

     

    eg. 

    Value1 = If(  1 <= Topic.RowCount,  Index(Topic.selectedOptionsTable, 1).Value,  "")

     

  • Verified answer
    HenryJammes Profile Picture
    Microsoft Employee on at

    Hi  @Nina131,

     

    For simple arrays, you can use the JSON formula, e.g.:

     

    JSON([1, 2, 3]) 

     

     

    But, for more complex cases, there's actually an undocumented node that you can set using the code editor view:

     

     - kind: SetTextVariable
     id: setVariable_IzY7HO
     variable: Topic.varYourString
     value: "{Topic.varYourTable}"

     

     

    HenryJammes_0-1708371465086.png

     

  • Nina131 Profile Picture
    44 on at

    Thanks so much!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 161

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 130 Super User 2026 Season 1

#3
Arild Aarnes Profile Picture

Arild Aarnes 61 Super User 2026 Season 1

Last 30 days Overall leaderboard