Save Metadata on Card Set button press

(Sebastian Weiß) #1

Hi,

I’ve got a card set with articles. It should be possible to order those items.

Those items come from an API.

Each Item has an article id.
Those article id has an unknown length.

If I press ORDER. I would like to save the Article Id to the meta data, like you can do with the “Ask a question” option.

How can I do this?

2 Likes
(Sebastian Weiß) #2

Alternatively there would be the list template. Maybe this also an option to achieve that.
Whit those lists there is:
"payload":"DEVELOPER_DEFINED_PAYLOAD"
maybe that can also be used.

But I’m currently not sure.

(John Jackson) #3

Hey @SebastianWeiss,

You can certainly use a list template, to do so you’ll need to use the FB docs to put the JSON together and use our Custom Request method.

Whatever you set in "payload" will come back to your bot as a message, so you can listen out for that message to trigger another (or the same) flow.

The current limitation of our own Send a Card Set method, is that you get back the button text, not a payload. So because each of your buttons is labelled ‘Order’, there’s no way of knowing which item the user wants to order.

You can use FB’s generic template with custom request to set a payload which could be the item name/ID or something as a workaround.