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 its schema as “tag_id”: Number, 3) add a repeat “repeat_prods” looping through the products, 4) add a nested repeat “repeat_tags” looping through each prd_Tags column (JSON field), 5) check if “tagList_Array” contains the current “repeat_tags” $value (tag-id) and 6) if not, add this $value (tag-id) to “tagList_Array”
My problem is that step 5 (ArrayList.contains) always returns false
So, I went with the where formatter and solved it:
I have to say that I was surprised from your workaround… I really like it and gonna study it for future use.
But now I have my whole project working on this way of handling the prd_Tags… It was from the first things creating and was made using the method of saving tagify values into database.
Sorry but It’s difficult now to change it… Sure on an upcoming project my friend I will remember your method.
But still have the question… How server-side ArrayList.contains works or how to apply?
Do you not need to add the array values and then split them, similar to (from another Project we do this to calculate extras for reservations) and its on the server side working with an array (maybe a better example):
Not sure if that just confuses the matter but you may have missed a step? Or I’m just off my head as usual! For which in that case ignore me entirely and slap me with a frozen trout!
I really appreciate your effort here but we’re missing the main question…
As you can see in my original post, I got my values into an ArrayList and then I had to check if the ArrayList contains the value of a repeat.
Then I used ArrayList.contains() because that is what it does (I SUPPOSE…)
ArrayList.contains() always returned false no matter what happens, so I canceled it and used the where formatter instead and solved what I wanted to do.
BUT… that amazing tool, ArrayList.contains() isn’t working? Or I’m using it in a wrong way?
That’s the way I would build my database if I was starting now a project…
But this project exists and work well, I have also found the way to handle my JSON field in several cases.
But I mean… We have a great tool in there ArrayList that is supposed to perform a specific procedure, the .contains(), but we don’t know how to use it?
Hey! Question!
The output of tagExists returns false?
Or is the condition that doesn’t apply?
What about using !tagExists instead of tagExists==false on the condition?