Hi,
I am trying to create a drop down list in Zobot by creating a plug. I think I am close but I just can't get it over the line and was hoping that someone could help me.
I had a little bit of help getting the script started (hence the comments)
- // Deluge script to handle SalesIQ chatbot response with a dropdown input for user selection
- // Initialise the response map that will be returned to SalesIQ
- response = Map();
- // Set the action type as 'reply' to send a message back to the user
- response.put("action","reply");
- // Add the initial greeting message to be displayed in the chatbot window
- response.put("replies",{"Hello there! Looking for anything specific?"});
- // Create a dropdown input field configuration
- dropdown = Map();
- dropdown.put("type","drop-down");
- // Specify input type as dropdown
- dropdown.put("placeholder","Select option");
- // Placeholder text shown inside the dropdown
- dropdown.put("select_label","Select");
- // Label for the dropdown button
- // Define the list of options available in the dropdown
- options = List();
- options.add({"label":"Premium","value":"new"});
- options.add({"label":"Basic","value":"existing"});
- options.add({"label":"Enterprise","value":"demo"});
- // Attach the options list to the dropdown configuration
- dropdown.put("options",options);
- // Optional: Enable multiple selection capabilities (uncomment to use)
- // dropdown.put("multiple", true);
- // dropdown.put("min_selection", 1); // Minimum number of selections required
- // dropdown.put("max_selection", 3); // Maximum number of selections allowed
- // Attach the dropdown input configuration to the response
- response.put("input",dropdown);
- // Return the complete response object to SalesIQ for rendering
- info response;
- return response;
When I test it, I get:
but the debugger shows
It looks like the information is there, but that it is not outputting correctly. I think it might have something to do with my output parameters:
I have also tried options list, string list, numbers list, link list, and complaining to the screen (just a little humour added in).
Is anyone able to help me with the solution to what I am doing wrong?
FYI: This is dummy data until I make the list work, then I will substitute real data into the script.
Thanks,
Z~