How to add multiple choice to bot?

Hi

Im learning travia…

I want to know ,can we add multiple choice(check box)…present i have option to add single choice …is it possible in botpress…?

If it possible can please share how to do this?

Thank you…

you can use the Choice-skill:
https://botpress.io/docs/latest/getting_started/trivia_skills/

hey…
thanks for your reply…i have gone through the document already…
in that they show how to install single choice…
so,my doubt is how to install multiple choice skill…
can you give list of skills that are available for botpress to install with this command ```
npm install --save @botpress/skill-*****

 ..

npm install @botpress/skill-choice Also, this is the only skill available publicly at the moment.

https://botpress.io/docs/latest/skills/

that means present we cant add check box for botpress…Right?

please tell can we do it or not? if yes how?

thanks

The choice-skill allow you to present the user with multiple choices to pick from.
So you send a msg and then present them with a choice:
image

The choices will then transition to whatever you want, i.e. another node, flow or action based on your configs.

ok, can we add multiple check box.?
…so that user can select multiple options at a time…

can we?

You will have to build this skill yourself. (Alpha) Documentation on how to create a Skill can be found here: https://www.evernote.com/l/ACoYIPn4YXFChLVk_cCL1pDe7EyCz_6SwP8 If you were able to do that, please consider sharing it with the community.

Hey - Is there any way that I can dynamically create a choice - e.g. with responses that are looked up from a datasource rather than having to use the ‘hard-configured’ Choices skill? …I was thinking of either writing my own module, or calling an API and then displaying the results in buttons…

Thank you for any help.

Hi Oliver,

This link might help you.

Regards,
JB

Hi JB,

Thank you very much for your help. I’ve managed to create it from JSON using the code below - I can then just create the JSON from any database source and fire over to create the buttons which works for my use case.

Kind regards,

Oliver.

const demoAction = async () => {

    const jsonEg = `{
  "text": "Offerings",
  "choices": [
    {
      "title": "Standard",
      "value": "std"
    },
    {
      "title": "Custom",
      "value": "cstm"
    },
    {
      "title": "Enterprise",
      "value": "ent"
    }
  ],
  "typing": true
}`
	const payloads = await bp.cms.renderElement('builtin_single-choice',  JSON.parse(jsonEg), event);
	await bp.events.replyToEvent(event, payloads);
}

return demoAction()

You can use single choice skill or actions to make dynamic choices

I created the dynamic choices but I can’t get the value… How I can get the value that the user select? I tried to get the value with {{temp.skill-choice-ret}} but is not had luck

Can help me ? @Oliver_Spencer @monika.verma @Haythamamin @jbperron
below attached my incident:

Did you find a solution for this?

you can simply use {{event.payload.payload}}

Hi Atarekosman. Could you please clarify further. How does the user get the prompts to select another choice?

Flow Editor

In the flow editor, the basic-skills choice can be used to have multiple choices.

API multiple choice

I think this thread could help How to Create Dynamic Choices from API response.