DEV Community

Discussion on: Twilio Hackathon Help Thread

Collapse
 
alessandrojcm profile image
Alessandro Cuppari • Edited

Hi there Twilio team!

The app that I'm building uses Autopilot along with the Whataspp API channel, so I have a couple of questions:

1) Can I have two fields in a collect action question? I.e, the very first question my bot asks is for the user's first name, it goes "Can I have your name" with a yes/no question if the user says yes then it redirects to the actual action which saves the name. But I think this isn't too organic, I would like to narrow those two questions down into one, so the bot asks "Can I have your name?" and then the user could reply "no" or something like "yes I'm name here"; I've seen some examples about custom fields but either they are too old or they do it via the console instead of with the json schema, which is why I want.

2) The API I'm building for the app relies heavily on the UserIdentifier being present (since it's the primary key I'm using to store the users) so, is there I way I can set the UserIdentifier in the Autopilot simulator? Currently, I'm testing with my phone via Whatsapp, but it would be much better to do it in the simulator with the debug view and all the details.

Thanks!

Collapse
 
dkundel profile image
Dominik Kundel

Hi Alessandro! I reached out to our Autopilot team to get you an answer to those questions. I'll try to get back to you as soon as possible.

Collapse
 
alessandrojcm profile image
Alessandro Cuppari

Cool Dominik, thanks!

Thread Thread
 
dkundel profile image
Dominik Kundel

Alright I got some answers for you :)
For your first question, you cannot collect multiple types at the same time but there is a workaround using "prefill"s. You can check them out here: twilio.com/docs/autopilot/actions/.... You could take that to extract the initial values for multiple fields and then it only collects the missing ones.
As for the useridentifier there's unfortunately no way to change it :(

Thread Thread
 
alessandrojcm profile image
Alessandro Cuppari

Cool, thanks I'll check it out the link. About the UserIdentifier, don't worry I think I can implement some sort of middleware to add that data to the incoming request when debugging.

Collapse
 
alessandrojcm profile image
Alessandro Cuppari • Edited

Hey Dominik, I have another question for you 😅

Can the routes taken by the bot to trigger tasks be constrained?

For example, say I have a menu task; which lists all of the bot's functionalities. I want all of those tasks to only be triggered from that menu action, kinda like a finite state machine; where states can only be triggered by another given state. Currently I'm using the listen action with the tasks sub-property; but still, there are actions that trigger when they're not suppose to.