Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Dialogflow cx form filling - multiple choice style question with 'other' option?

I am completely new to Dialogflow CX so apologies if this is obvious - but I couldn't find an answer from looking through documentation plus a couple of tutorials.

I want to create an agent to onboard someone onto a career coaching call. I want the chat agent to first gather some parameters - name, age, location and career interests.

For career interests, I'd like to have some default options presented for the particular sectors our service covers in-depth (e.g. construction, transportation, utilities), and allow the user to answer with any type of career they want help with, so free text.
If this was a web-form instead of a chat based interaction, this would most naturally be done as a multiple choice set of checkboxes, with an other option that then prompts for free text. What is the best-practice / most natural way to capture this information with a Dialogflow CX chatbot?

I've tried creating a custom entity, career_interests, and have listed entities for different industries/sectors. When testing it recognises the entities I've explicitly added (or their synonyms if I've added them) but it won't let me enter something else entirely (e.g. farming). I've tried setting up the custom entity as a list entity (by ticking entities only option) but this doesn't seem to make a difference.
How can I best handle and capture any other response from the user and store it in this parameter (or another parameter if that's the way to do it?).

For testing I'm just then transitioning to a page that confirms back what the user has said, but the real interaction will include this information when booking an appointment.






Solved Solved
0 2 883
1 ACCEPTED SOLUTION

Hi @Joe_McFadden,

Welcome to Google Cloud Community!

Dialogflow CX's predefined entities might not always cover every possible user choice, especially when you have a custom entity. Here are some workarounds which can help you with your implementation:

  1. Custom Entity: Keep your existing "career_interests" entity as a list, but populate it with the specific sectors you want to highlight (construction, transportation, utilities, etc.).
  2. Use @sys.any for Open-Ended Input: Create a new parameter of type @sys.any. This will capture any text the user enters.
  3. Use the Intent Structure below:
    • Training Phrases:
      • Include examples that use both your sector entity and the new parameter (e.g other_interest) mentioned in #2. An example would be:
        1. "I'm interested in {career_interests} or {other_interest}."
        2. "My interests are {career_interests} and {other_interest}."
        3. "{career_interests} and {other_interest} are the fields I'm interested in."
    • Response:
      • In your response, check if other_interest has a value.
      • If other_interest is not empty, include it in the confirmation message.

Example Conversation Flow:

Agent: "What are some career areas you're interested in? We specialize in construction, transportation, and utilities. Feel free to tell me about any other areas that interest you."
User: "I'm interested in construction and farming."
Agent: "Great! So you're interested in construction. And you also mentioned farming - is that correct?"

You may also want to consider these best practices before doing this:

  • Handling other_interest: You might want to add logic to your agent (or a fulfillment webhook) to process and categorize other_interest if it's important to group or analyze these responses.
  • User Experience: Ensure that the agent's responses are clear and confirm the information gathered accurately, especially when dealing with free text input.

I hope this helps.

View solution in original post

2 REPLIES 2

Hi @Joe_McFadden,

Welcome to Google Cloud Community!

Dialogflow CX's predefined entities might not always cover every possible user choice, especially when you have a custom entity. Here are some workarounds which can help you with your implementation:

  1. Custom Entity: Keep your existing "career_interests" entity as a list, but populate it with the specific sectors you want to highlight (construction, transportation, utilities, etc.).
  2. Use @sys.any for Open-Ended Input: Create a new parameter of type @sys.any. This will capture any text the user enters.
  3. Use the Intent Structure below:
    • Training Phrases:
      • Include examples that use both your sector entity and the new parameter (e.g other_interest) mentioned in #2. An example would be:
        1. "I'm interested in {career_interests} or {other_interest}."
        2. "My interests are {career_interests} and {other_interest}."
        3. "{career_interests} and {other_interest} are the fields I'm interested in."
    • Response:
      • In your response, check if other_interest has a value.
      • If other_interest is not empty, include it in the confirmation message.

Example Conversation Flow:

Agent: "What are some career areas you're interested in? We specialize in construction, transportation, and utilities. Feel free to tell me about any other areas that interest you."
User: "I'm interested in construction and farming."
Agent: "Great! So you're interested in construction. And you also mentioned farming - is that correct?"

You may also want to consider these best practices before doing this:

  • Handling other_interest: You might want to add logic to your agent (or a fulfillment webhook) to process and categorize other_interest if it's important to group or analyze these responses.
  • User Experience: Ensure that the agent's responses are clear and confirm the information gathered accurately, especially when dealing with free text input.

I hope this helps.

Thank you for your detailed and helpful response @cassandramae - I will implement this approach in my test agent.