MakePostbackChoice not working as expected

hi - I am trying to create a Digital Bot Flow with Web Messaging that uses a carousel to present different cards, each card with a couple of choices - one a postback choice and one a url choice.

I'm facing a challenge when trying to change the label on the postback choice - it simply doesn't behave per the documentation, as best I can tell. For example, having simplified everything down to just creating one card and one choice, rather than a carousel of cards, the following example renders a single choice labelled 'Label' and with a postback of 'Label', when I am expecting the card to show a label as is happening but I would expect the postback to be 'offer1'? If I drop the second parameter, then I get a label of offer1 and a postback of offer1 (as expected). Both offer1 and Label are valid slot values for the purposes of the troubleshooting (if the postback does not match a valid slot value then the card is not shown).

Any ideas why I don't get a label of Label and a postback of offer1?

MakeChooser(
MakeCard(
"Title",
"Description",
MakeList(MakePostbackChoice("offer1", "Label")),
MakeImageFromUrl(NOT_SET)
)
)

Hi @stephenwalter17
After reviewing the documentation in Architect for the MakePostbackChoice function, you are right in expecting that the first parameter is the value returned to the flow at runtime, and the second parameter is the Label. If this is not the outcome you're getting, please open a case with Care to further investigate the issue.

To close this out, this was user error. The Label is returned as the postback to the UI, suggesting that maybe the slot is not returned correctly but it is. Of note, I needed to add the label value to the slot values, and not as a synonym, in order for the choice to appear on the card.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.