How to get data from a tag type field in my collection with WixDataQuery?/¿Cómo obtener datos tipo tag (arreglo de cadena) en mi colección?

I am building a mega search like wix:
My code is similar to the link, I use checkboxGroup in my mega Search, I need to compare the data they select from the checkboxGroup with the data from my collection (tag type field) to filter that information and show it on a repeater.
//Estoy construyendo una mega search como wix:
Mi código es parecido al del link, Utilizo checkboxGroup en mi mega Search, necesito comprar los datos seleccionados del checkboxGroup con los datos en mi colección (datos tipo tags o arreglo de cadenas) para filtrar la información y mostrarla en un repetidor.

the data in the collection is like: // Los datos de la colección son así:

My code is based on the wix megaserch, I use these code to filter with the other elements like sliders or inputs: // Mi código esta basado en el megaSearch de wix, utilizo este código para filtrar otro tipo de elementos de entrada como, sliders o inputs:

After consulting and filtering, I send this data to the repeater, so that only the matching information is displayed on the repeater (like wix megaSearch) // Después de consultar y filtrar, envío los datos al repetidor para que muestre solo la información que coincide (tal como el mesearch de wix).

The problem is that I can’t get the data using wixDataQuery filters like eq (), contains (), ge () or any of those because the data in the collection are tags (strings array) // El problema es que no puedo obtener los datos usando los filtros de wixDataQuery tales como eq (), contains (), ge () o cualquiera de ellos porque los datos de mi colección son tags (arreglo de cadenas).

How I can do it, using wixDataQuery ?.. // Como puedo hacerlo utilizando wixDataQuery ?..

In the wix MegaSearch, checkBoxGroup use field boolean, but I need use tags (string arrays) // En el mega Search de Wix el checkBoxGroup usa campos booleanos, pero necesito que mi campo sea de tipo tag (arreglo de cadenas).

I tried like this:

but it doesn’t work…

Could you help me, please?:disappointed_relieved:
@Steven @Sheyla @Oded @Eugene Olshenbaum you who are pro :blush:, do you have some idea?

1 Like

Please ask your corvid related questions here .
I haven’t done any projects with tag fields, but if “.contains” query is not working maybe you can query without using the tag query line and then use code to do a second filter/search on the result of your first query for the required tag .

The problem is that the wixDataQuery functions ask for two parameters for example: constain. (‘PropertyName’, ‘string’) to compare the string with all the data that are in the property name, this is simple when it is a single value in the field from my collection but when there is a Strings array I can’t compare because they don’t match, what I need is to enter the array of strings to compare the data that I enter in the wixDataQuery function, but I don’t know how to use wixDataQuery to do that.
Is that I need the data I get to be of type wix_data.wixDataQuery to enter it in the repeater.

1 Like

I don’t know how you did the coding. But as i said earlier you can use code to do a second filter/lookup (u sing for loop or something ) to again search for the tag from the results of the first query.

1 Like