I want to accomplish a simple operation: checking if the rule value is a substring of the data value.
Let's say the rule value is 'check'
and the data value is 'checking'
. It must return true
since the rule value is a substring of the data value.
Here is my current rule:
{
"and": [
{
"in": [
{
"var": "ACTION1"
},
"check"
]
}
]
}
And here is my data:
{
"ACTION1": "check the dictionary"
}
Currently, this setup won't return true unless we place the rule value and data value in the opposite order. However, I don't want to do this since the data value is dynamic.
Can you please help me?
I can't find
json-logic-js
tag. sorry for taggingjsonlogic
i fixed by transferring the value at the top of
var
object.rule data
Basically,
var
object -dataValue.includes(ruleValue)
(js)var
object -ruleValue.includes(dataValue)
(js)