Working with Array lists, issue with Contains and indexOf

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.

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