Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Copilot Studio - General
Answered

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:
  • garrybd6 Profile Picture
    6 on at
    Re: Asking a question with List Variable from results from flow

    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

  • Verified answer
    CKKashyap Profile Picture
    Microsoft Employee on at
    Re: Asking a question with List Variable from results from flow

    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

     

     

     

     

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
Pablo Roldan Profile Picture

Pablo Roldan 9

#2
stampcoin Profile Picture

stampcoin 8

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 8

Overall leaderboard