related products

hello ,
i’m trying to connect a gallery to my product collection and filter the gallery by the “CustomTextFields” column .
my gallery is connected to the the data set .
code :
import wixData from ‘wix-data’;

export function dataset1_ready() {
$w(‘#dataset1’).setFilter(wixData.filter().contains(‘CustomTextFields’, ‘pro’));

}
this is a sample data from CustomTextFields column:
[{“title”:“pro”,“maxLength”:500,“mandatory”:false}]


The filter is not working . why??? :slight_smile:

CustomTextFields is an array based field. You Will need to do something like customTextFields[0].title = ”pro”

Hi Adam,

I believe your problem is that you didn’t write the correct Field Key inside the setFilter() function.
Check the Field Key of the field “CustomTextFields” ( I believe its should be c ustomTextFields) and add the same code that you have written.

Have a nice day, and best of luck!
Sapir

thank you Andreas ill try

thank you Sapir ill check it out