How to match user input to entity?

I am trying to match user input to an entity I’ve created with a list of possible answers to a question.

Say for example I want users to name at least 2 Dutch provinces.
I have an entity with all 12 provinces in it.

The user answers with: Utrecht and Gelderland

How do I check if these two match with the entity?

Hey @dvanprooijen,

I’m actually going to give you an easier workaround that involves the AI task:

  • You could set up an AI task in which the task instructions would look something like “Analyze the user’s message and set the boolean variable “provinces” to true if he or she mentioned 2 Dutch provinces.”
  • The AI task input would be setup with “User’s message: {{event.preview}}”
  • The result would be stored in “provinces”, a boolean variable you’d have to create
  • Afterwards you’d have to use that variable as a transition, so “workflow.provinces = true” and another transition if the user didn’t mention 2 provinces in their message which could simply an “always” and redirects somewhere else.

You can always change the prompts a bit so that it works better.
Let us know if that works for you! :grin:


Is it also possible to do it without the AI task and just with the entity option? How do you do that?

Hi @spiron

Yes, you can, longer path but it is possible.

But you will have to add each province with its synonyms. In the flow, you can use a Capture Information card and choose its type to be your entity. And from there, it is trial and error.

Or you can achieve it also through the code, in an Execute Code, you can use the JSON tab to guide you from there.

Thank you for your reply. Is it possible to have the user type the answer themselves?Through the Capture Information card with the entity, I only get a multiple choice option for the user.

In the capture information, did you choose your entity type?