Hi everyone
I keep coming up stumped on this one.
I’m trying to use the .hasSome query function. I’m wanting to see if any part of a string appears in the field searched using .hasSome . It’s my understanding I need to convert the string to an array, but I can’t seem to make it work properly.
The string is generated when people check/uncheck boxes
Then I just delete the last character of the string using string.length - 1 (this creates my string)
The populated string reads: “blue”, “green”, “yellow”
var str = "blue", "green", "yellow";
var array2 = [];
array2.push(str)
wixData.query("NameOfData")
.hasSome("field", array2)
.find()
.then((results) => {
...
Could someone please nudge me in the right direction?
Many thanks!
Thomas