Change the amount of buttons in a skill-node: 'choice'

Hello everyone

I wanna make a bot and this is the problem I am facing atm.

Let’s say I have a small chatbot showing the status of products.
Let’s also say there are 1000 different products (the amount can change from day to day).

Some of those 1000 products require additional questions and the number of answers is between 2 and 6. (This can also change for the same product depending on the market)

I definitely need buttons.
Is there a way to do this in 1 skill node, or do I need 1000 different nodes?

I’m using Botpress v12

Thank you in advance.

Hi @arthur.pluym ,

Thanks for your message.

Please note that this Community Forum supports Botpress cloud users only.

Any v12-related questions should be posted on the GitHub Community forum.

Cheers :raised_hands:

Hello how about doing that in the Botpress cloud? i use the free cloud Botpress version:))

Hi @mmeidihi.93 ,

Can you give me more context about what you are trying to achieve?

the main idea is same as Mr. arthur up there, but the differences is i have many files (more than 1000 files) in microsoft sharepoint and before accessing to the spesific file, the user must answer ‘additional questions’

is there a way to do it here in botpress?

Hello, @bassam.tantawi @mmeidihi.93

We are looking for a way that can have a skill node: ‘single choice’ where the buttons are not predefined but will be defined based on the response data from an API.

Thank you very much

Hi @arthur.pluym , currently no, but we are working on something that will allow you to do so through the execute code,

Hi @mmeidihi.93 ,

Are those questions dynamic?

@arthur.pluym But there is a workaround, it is a bit long but can help. If you are interested, let me know.

Absolutely! That would be wonderful.
I was trying to render a single choice, but I got this error and I can’t seem to find a solution: e.choices.map is not a function.

What is the workaround?

The workaround is totally on the flow itself; we can design some kind of a loop with a set of transitions, I did something very high-level and just a structure to give you an idea about what I am thinking of:


Take a look and tell me what do you think.

That could work indeed, but it is not really what I am looking for tbh.
Thank you for this idea. I’m gonna try this.

@arthur.pluym , I totally understand; it is just workaround.