AI Zone Admin Forum Add your forum

NEWS: survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Pattern containing JSON data not matching

Hi All,

Have you had any success using a JSON object as part of your matching pattern? I’m trying to check if a user has clicked a button (the text is stored in a JSON object), but I keep matching the first option, I believe it’s because the JSON construct is returning a blank in a pattern matching context.

I’ve tried using:
a: ($jsonobject.text[0])
a: (^eval($jsonobject.text[0]))
a: (^jsonpath(0 $jsonobject.text))

all with the same effect (anything will match them).

Any hints what to try next?


  [ # 1 ]

Not sure of the full rule context, since you are showing rejoinders. But first thing to try is to put the json text onto a simple variable and then pattern matching on the variable. THen you can more easily use :trace to see the values involved.
One question is what is the text—is it a simple word or is it a series of words.


  [ # 2 ]

u: ($var)  as a test checks ONLY to see if the variable has a value
u: ($var?) checks to see if the content is in the sentence


  login or register to react