Zobot drop down list

Zobot drop down list

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)

  1. // Deluge script to handle SalesIQ chatbot response with a dropdown input for user selection
  2. // Initialise the response map that will be returned to SalesIQ
  3. response = Map();
  4. // Set the action type as 'reply' to send a message back to the user
  5. response.put("action","reply");
  6. // Add the initial greeting message to be displayed in the chatbot window
  7. response.put("replies",{"Hello there! Looking for anything specific?"});
  8. // Create a dropdown input field configuration
  9. dropdown = Map();
  10. dropdown.put("type","drop-down");
  11. // Specify input type as dropdown
  12. dropdown.put("placeholder","Select option");
  13. // Placeholder text shown inside the dropdown
  14. dropdown.put("select_label","Select");
  15. // Label for the dropdown button
  16. // Define the list of options available in the dropdown
  17. options = List();
  18. options.add({"label":"Premium","value":"new"});
  19. options.add({"label":"Basic","value":"existing"});
  20. options.add({"label":"Enterprise","value":"demo"});
  21. // Attach the options list to the dropdown configuration
  22. dropdown.put("options",options);
  23. // Optional: Enable multiple selection capabilities (uncomment to use)
  24. // dropdown.put("multiple", true);
  25. // dropdown.put("min_selection", 1); // Minimum number of selections required
  26. // dropdown.put("max_selection", 3); // Maximum number of selections allowed
  27. // Attach the dropdown input configuration to the response
  28. response.put("input",dropdown);
  29. // Return the complete response object to SalesIQ for rendering
  30. info response;
  31. 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~