Node server (stable and beta)
Not putting this down as a bug yet as it may well be me, first real foray into server connect array lists. I can create a list from a query but don’t seem to figure out how to use Contains() and indexof()
See video
Maybe you should Brian… I’ve seen a lot of refernces to that subject but not actual solution.
Hey guys,
I need some help here…
I have a table containing tags for products “product_tags”
[image]
And I have a product table “products” that have a column of tags for each product (JSON field)
[image]
What I’m trying to do is to get a unique list of the “used” tag_ids in my products table…
For the above set of data I should get [“2”, “1”, “6”]
My way to go was:
1) add a multiple records query pulling the product Tags “qr_getProd_Tags”,
2) add an ArrayList “tagList_Array” and define …
Ah, yes i see you hit same issue
Unfortunately there is zero documentation on contains() and indexOf() so was working in the dark although i can normally work these issues out quite easily, Wappler is pretty intuitive.
Switched to bug report, if it is my technique then hopefully we will get told how to do this.
1 Like
Irony is i found this trying to do a tutorial to cover the issues not documented!
Think i may have found the issue
Contains only works on arrays, not objects. found this in a post from Teodor
Arrays can contain strings list:
{
"myarray": [
"San Francisco",
"Boston",
"Amsterdam",
"Paris",
"Tokyo"
]
}
or objects:
"myarray": [
{
"city": "San Francisco"
},
{
"city": "Boston"
},
{
"city": "Amsterdam"
},
{
"city": "Paris"
},
{
"city": "Tokyo"
}
]
So ["San Francisco","Boston","Amsterdam","Paris","Tokyo"]
(first example) contains Paris
But [{"city":"San Francisco"},{"city":"Boston"},{"city":"Amsterdam"},{"city":"Paris"},{"city":"Tokyo"}]
does not.
this kind of makes the facility less useful
I see what you saying…
But I thing that this is not an “ArrayList”, it could be be a setValue array in that case.
Or I’m wrong?
Basically it appears if you define a schema you get an object, if you don’t you get an array
SO
this with no schema defines produces an array
where this, importing the query with Add All
produces