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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Asking a question with...
Copilot Studio
Unanswered

Asking a question with List Variable from results from flow

(0) ShareShare
ReportReport
Posted on by 6

I have a PVA (Power Virtual Agent) that asks users a series of questions before triggering a flow. This flow interacts with an SQL Server to retrieve specific rows of data. Within the flow, I use 'Apply to each' and 'Append to array variable' actions to build an array of results. I am trying to pass this list back to PVA to then use it to ask another question to my users listing the options that are in my results. 

garrybd6_4-1693253394492.png

 

However, when trying to build the question card I'm getting an error telling me the display name is missing, and when i look at the code it tells me that the display name is not allowed... 

 

garrybd6_0-1693253139489.png

 

garrybd6_1-1693253146417.png

 

garrybd6_2-1693253153837.png

 

I take my JSON and turn it into a record and then extract the field into a table for which I'm trying to pass as a variable options to the question

garrybd6_3-1693253263408.png

 

Categories:
I have the same question (0)
  • Verified answer
    CKKashyap Profile Picture
    Microsoft Employee on at

    Hi @garrybd6 ,

    When the table (options from a  list variable) element is of type record, then it must contain a field called "DisplayName" that PVA uses to render as a suggested action buttons.

     

    For example, in the screenshot below, you can see that the table has 2 records and that each record has a DisplayName field (in addition to k1 and k2).

     

    CKKashyap_0-1693279891760.png

    This lets d1 and d2 to be rendered as suggested action buttons as shown below

    CKKashyap_1-1693280236797.png

     

    Here's a textual representation of the yml shown above

     actions:
        - kind: SetVariable
          id: setVariable_usLW26
          variable: Topic.Var1
          value: "=[{k1: \"v1\", k2: \"v2\", DisplayName: \"d1\"}, {k1: \"v3\", k2: \"v4\", DisplayName: \"d2\"}]"

        - kind: Question
          id: question_sYn2o5
          interruptionPolicy:
            allowInterruption: true

          variable: init:Topic.Var2
          prompt: Enter
          entity:
            kind: DynamicClosedListEntity
            items: =Topic.Var1
     
    HTH,
    Kashyap

     

     

     

     

  • garrybd6 Profile Picture
    6 on at

    Magic. Converting my JSON response to have a name field for "DisplayName" worked.  I didn't originally follow that it was looking for that as a name in my name/value that I returned. 

     

    Thank you Kashyap

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 > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 255 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 205 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 101 Moderator

Last 30 days Overall leaderboard