Extracting mulitple attributes from single message

(Paul D) #1

Is it possible to extract multiple bits of information from a single mesage?

For example:

User: Can you list all shirts below $100?

Is there a way for the bot to understand,

  1. User wants a list of shirts
  2. That list should be filtered to shirts below $100 in price

Right now I’m stuck with

Bot: What would you like to see?
User: Shirts
Bot: What’s your higher price?
User: $100

Thanks!

(Daniel Beckett) #2

Hi Paul,

I could certainly see a way of capturing the category that a user wants to search, shirts, socks, footwear etc. by using Filters to set Attributes based on the message received by the user.

Something like:
Set Attribute > Name: Category, Value: Shirts (Filter) IF {{new_message.message}} contains the value “shirts”
Set Attribute > Name: Category, Value: Socks (Filter) IF {{new_message.message}} contains the value “socks”

The tricky part is capturing the budget from the message since there’s a lot of options there. You could try to restrict your user to increments so that you can look for 20,50,100,150,200 etc. This would let you use the above method to set another attribute category for budget.

It could get a bit messy using this method since you’ll have so many filters for your Flow to process but depending on the scope of what you’re doing it could potentially work.

For a more elegant solution you could look into using services like api.ai and wit.ai that can help to detect the intent of a user’s message. You could pass information back and forth by using our Webhooks & HTTP service so that your bot provides a more conversational experience.

Thanks,
Dan