Adaptive Card- not showing choice response?

Options

Hello all- I'm designing an adaptive card so fundraisers can submit a change to an existing proposal. For some reason in the response flow I want it to display the Proposal Name that was chosen by the Fundraiser but I'm getting “Undefined” in the results.

I have a choice set in the card set up which pulls in the Individual's Proposals. That works.

{
"type": "Input.ChoiceSet",
"choices": @{body('Select-_Proposals_on_Record')},
"placeholder": "Proposals on Record",
"id": "ProposalsRecord",
"label": "Proposals- Anticipated, Submitted on Record"
},

When the response comes in I have it under http request received like this:

"ProposalsRecord": {

"type": "string"

},

When I add the field to a String Variable the appears as “Undefined”.

I'm not sure what I'm missing here. In the form many of them only have one and you choose it like below

11c0a301f5bfcd1fd1a4db96d7b3af2e-huge-im

Thanks for any help!

-Carol

Comments

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @Carol Grant
    couple of things that's not very clear to me:

    • is the adaptive card being loaded onto proposal (opportunity record) page?
      • when you say “proposal name that was chosen by the fundraiser” do you mean that the fundraiser is on the specific proposal page?
    • OR is the adaptive card being loaded onto the constituent page and you display all the constituent's proposal into the adaptive card that then ONE is selected by the fundraiser?
  • @Alex Wong-

    it's the second one:

    • OR is the adaptive card being loaded onto the constituent page and you display all the constituent's proposal into the adaptive card that then ONE is selected by the fundraiser?
  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @Carol Grant
    I can't help much from there then, as I have not done Adaptive Card to know its inner working. Maybe someone who has worked on Adaptive Card more can chrime in.

    From a programming perspective, in order for various properties of an item (object) to show, you need to have the data be structured such that it is an array of objects with properties. The Adaptive Card “form element” will need to know to pick up a specific properites from the selected object to show. So I guess first check your array of objects and then check if your object's properites are connected to the form element.

  • @Ashley Moose - have you encountered this one before?

  • @Carol Grant
    Is this two separate flows? One to display the form and one to handle the submissions? If so, if you go to the run history of one of the flows that handles the submissions, can you see the information you're looking for in the trigger output? Or is it showing as Undefined there as well?

  • @Carol Grant My thoughts are similar to what Ben is asking. Can you share a screen shot of the output of your trigger (from the results screen)? And a screen shot of how you are adding data to the string variable (from the edit screen)?

  • @Ben Regier @Ashley Moose

    Thank for chiming in both of you! Correct, 2 flows and the issue is in the 2nd flow where I'm getting the responses back.

    Here is where I have the response as a string and I know it's the same ID as in my card. We're looking at ProposalsRecord.

    8ac4d71732353a6e1b6b1388184f1109-huge-im


    Here's where I am seeing “Undefined” when really I wanted the Proposal Name to appear. Below is the http request is received output.

    Which in my example would be Flannery Annual Fund Anticipated Ask. I've tried a few things, changing the card to be multiselect=true, style=expanded just to see if it was a card issue.

    a758cea3cb45c71ff37b632c44bb5199-huge-im

    I haven't seen this before and I've done a few cards but none with a choice set that has dynamic choices. So I didn't know if I had to do something special in the card.

    Here's the card part again

    {
    "type": "Input.ChoiceSet",
    "choices": @{body('Select-_Proposals_on_Record')},
    "placeholder": "Proposals on Record",
    "id": "ProposalsRecord",
    "label": "Proposals- Anticipated, Submitted on Record"
    },

  • @Carol Grant Thank you for sharing - that is helpful to see. I have done choice outputs before so I'm confident we can get this to work.

    Can you share what "choices": @{body('Select-_Proposals_on_Record')} looks like from the initial flow - both the output of that action and how you are building it?

  • @Ashley Moose- Here is my choices. I pulled in List opportunities- then did a condition on 3 different Proposal Statuses. After that I appended the Name and the Status to my Proposal List array.

    5d45b3a560736fda090caaacf9415af0-huge-im

    Then I took that array, parsed it and did a select

    9f17c50c0fc224bd6666fe7ab1867ba3-huge-im


    It appears correctly on the form. For the Value I have item() maybe that's my problem?

  • @Carol Grant That most likely is your problem. From my experience I've found the Title value in the choice is what we see in the choice drop-down on the adaptive card but the Value value is what is passed back as the data element.

    Also, all of the values passed back from the response are read in string format. Since the item() looks to be an Object instead of string, it's likely causing that Undefined error

    I usually either make the Title and Value the exact same, OR I set the Value to be the ID of the record being selected in the choice drop down. That way you have that ID to work with in the next flow but users don't have to see the ID when viewing the drop-down choices.

    Give that a try and let us know if it still causes issues!

  • @Ashley Moose- That was exactly my problem! I made them the same and I can now see the value!! Thank you for making me look there, such a simple check I should have done. Now I realize they should be the same.

Categories