Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Copilot Studio - General
Answered

PVA Preview. Power FX string to table fine. BUT cannot get table to display in an Adaptive card column.

(0) ShareShare
ReportReport
Posted on by

I want to display a variable number of items so using an Adaptive card column set/column.

In Power Automate I can surface as an array.

In PVA Preview have converted string to table. 

Each item is {"type":"TextBlock","text:"(field contents)"},

The table surfaces as a message like this but doesn't display in column. 

["{\u0022type\u0022:\u0022TextBlock\u0022,\u0022text\u0022:LEX-1019},","{\u0022type\u0022:\u0022TextBlock\u0022,\u0022text\u0022:LEX-1108},","{\u0022type\u0022:\u0022TextBlock\u0022,\u0022text\u0022:LEX-1019},","{\u0022type\u0022:\u0022TextBlock\u0022,\u0022text\u0022:LEX-1019},","{\u0022type\u0022:\u0022TextBlock\u0022,\u0022text\u0022:LEX-1108},",""]

 

Does a table translate as an array to an Adaptive card element? Hlep please. Thanks, Richard UK

Card syntax is 

{
      type: "Container",
      items: [
        {
          type: "ColumnSet",
          columns: [
            {
              type: "Column",
              width: "stretch",
              items: (Topic.SearchResultsTable)                      
            },
  • Community Power Platform Member Profile Picture
    on at
    Re: PVA Preview. Power FX string to table fine. BUT cannot get table to display in an Adaptive card column.

    Hi Henry. Success with your help.
    I probably don't get it but my coding of split was to produce a table, which it did.

    Split(Topic.Column,"}")

    For low code this was easier to me than the ParseJSON you recommended and I have now got it to work.

    Originally I did put the code in the adaptive card itself but nothing happened, I'd obviously done something wrong.
    I then put the code in to create a variable.

    ForAll(Table(ParseJSON(Topic.Column)),{type:Text(ThisRecord.Value.type),text: Text(ThisRecord.Value.text)})
    This then surfaced as an error that I could fix with the JSON syntax from Power Automate, where it didn't when embedded in the card.
    I can now press on but attach the code for my standalone topic and screenshot of the power automate string with the PVA conversation surfacing all 3 columns.
    Very grateful for your help. Cheers, Richard  

      

     

  • Verified answer
    HenryJammes Profile Picture
    on at
    Re: PVA Preview. Power FX string to table fine. BUT cannot get table to display in an Adaptive card column.

    I'm not sure why you're trying to split columns.

     

    Say Power Automate returns this, in your Topic.Column variable:

     

    {
     "text": "DOG",
     "type": "TextBlock"
    },
    {
     "text": "CAT",
     "type": "TextBlock"
    }

     

     

    To use this as dynamic content in your adaptive card, for example in a ColumnSet items, I would reference the variable using this:

     

    ForAll(
     Table(
     ParseJSON(
     Topic.Column
     )
     ),
     {
     text: Text(ThisRecord.Value.text),
     type: Text(ThisRecord.Value.type)
     }
    )

     

     

  • Community Power Platform Member Profile Picture
    on at
    Re: PVA Preview. Power FX string to table fine. BUT cannot get table to display in an Adaptive card column.

    Hi Henry, thanks for asking.
    I can successfully code the type/text string syntax to surface an array in a column set, as demonstrated in my examples showing the table created using Power FX or direct in the adaptive card. 

     

    When Power Automate sends the required syntax as a text string it needs to be converted into a table.

    Whilst the split function creates the table okay it also introduces the unicode \u0022 apostrophe escape codes. 

    These codes prevent the table being surfaced in the column set.

    I have tried 273 variations on a theme; with/without apostrophes, single quotes, no quotes, embedded quotes, square brackets, no square brackets, re splitting strings etc, etc.

    My card topic example can surface tables in columns sets but not the table with the escape codes.

    All code in previous attachment with examples shown previous (-1)
    It's a real blocker for me so very keen to get it resolved. 

    Cheers, Richard

  • HenryJammes Profile Picture
    on at
    Re: PVA Preview. Power FX string to table fine. BUT cannot get table to display in an Adaptive card column.

    Hi @Anonymous, it looks like you made some good progress.

    Can you clarify where you get stuck? Is it with rendering the below array as dynamic content in a ColumnSet in an adaptive card? (feel free to also share a sample JSON for it with dummy data).

     

    {
     "text": "DOG",
     "type": "TextBlock"
    },
    {
     "text": "CAT",
     "type": "TextBlock"
    }

     

  • Community Power Platform Member Profile Picture
    on at
    Re: PVA Preview. Power FX string to table fine. BUT cannot get table to display in an Adaptive card column.

    Just discovered the code editor!
    Neat so attached is the topic setup to try to get columns to work in an Adaptive card based on a string sent from Power Automate.

    Described above as the table resulting from a split is corrupted by Unicode escape characters. 

    Cheers, Richard 

  • Community Power Platform Member Profile Picture
    on at
    Re: PVA Preview. Power FX string to table fine. BUT cannot get table to display in an Adaptive card column.

    I can now prove a table in PVA will behave as a Power Automate array and surface rows in an Adaptive Card column set.

    Hard code in PVA example card surfaces two columns.

    One table created with Power FX
    Topic.CollectColumn
    [ {type: "TextBlock", text:"Apples"},{type:"TextBlock",text:"Pears"}]

    The other coded in the card
    Produces

    Apples Fred
    Pears Harry

    {
    type: "AdaptiveCard",
    '$schema': "http://adaptivecards.io/schemas/adaptive-card.json",
    version: "1.3",
    body: [
    {
    type: "Container",
    items: [
    {
    type: "TextBlock",
    text: (Topic.Column)
    }
    ]
    },
    {
    type: "ColumnSet",
    columns: [
    {
    type: "Column",
    width: "140px",
    items: (Topic.CollectColumn)
    },
    {
    type: "Column",
    width: "140px",
    items: [
    {type: "TextBlock", text: "Fred"},
    {type: "TextBlock", text: "Harry"}
    ]
    }
    ]
    }
    ]
    }

    I setup a topic which calls Power Automate returning a fixed two element string as type and text above.

    The problem is when the split function to convert it into a table introduces Unicode '\u0022' escape characters for each apostrophe.
    Even if they are removed from the Power Automate string connection they appear in the table after the split and it all breaks.

    Power Automate init string
    {"text":"DOG","type":"TextBlock"},{"text":"CAT","type":"TextBlock"}
    Screen shot shows some examples. Many variations with/without apostrophes and reformatting existing strings to get to here and nowhere.

    Any ideas gratefully received please.

    Cheers, Richard

  • HenryJammes Profile Picture
    on at
    Re: PVA Preview. Power FX string to table fine. BUT cannot get table to display in an Adaptive card column.

    The FactSet is just an example. I think the key thing here is to understand what part of the adaptive card JSON you want to make dynamic, generate it in JSON format in Power Automate before transforming it into a Power Fx table in your adaptive card formula. 

  • Community Power Platform Member Profile Picture
    on at
    Re: PVA Preview. Power FX string to table fine. BUT cannot get table to display in an Adaptive card column.

    Hi Henry,

    Thanks for the extensive reply, I'll check it out properly when I've read up on 'Fact Sets', I'm not sure they present as an array would do in a column item as I can drive from Power Automate when surfacing in Team chats. Will let you know how it goes. 
    Cheers, Richard    

  • HenryJammes Profile Picture
    on at
    Re: PVA Preview. Power FX string to table fine. BUT cannot get table to display in an Adaptive card column.

    Hi @Anonymous,

     

    I’ve done and documented something very similar. Can you check this post and let me know if that helps you?

    https://powerusers.microsoft.com/t5/General/How-to-create-an-adaptive-Card-for-Multiple-options/m-p/1933390/highlight/true#M4733

     

    Henry

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Copilot Studio - General

#1
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 25

#1
Pablo Roldan Profile Picture

Pablo Roldan 25

#3
stampcoin Profile Picture

stampcoin 10

Overall leaderboard