Forum Discussion
How to Filter Multiple Values in a String Field (e.g., Product Categories)?
- 3 months ago
Hello Arso,
Thanks for your input—I had a similar thought, but I’ve found a solution that works perfectly.
It turns out Braze handles this in a rather peculiar way, but it works:
When you create a field in a catalog via the API, you can set the type to "ARRAY". This enables the use of the operator "Include Value". Interestingly, this option is only available if the field is created via the Catalog API, and I’m not sure why that’s the case.
I discovered this while reading the documentation on creating selections via API:
Create Catalog Selections APIHere’s my workflow:
- I create the field via the API.
- Then, I upload a CSV file with the data (next step: automation).
The data in the array field looks like this:
["value1", "value2", "value3"]Hopefully, this solution can help someone else as well!
Hello Arso,
Thanks for your input—I had a similar thought, but I’ve found a solution that works perfectly.
It turns out Braze handles this in a rather peculiar way, but it works:
When you create a field in a catalog via the API, you can set the type to "ARRAY". This enables the use of the operator "Include Value". Interestingly, this option is only available if the field is created via the Catalog API, and I’m not sure why that’s the case.
I discovered this while reading the documentation on creating selections via API:
Create Catalog Selections API
Here’s my workflow:
- I create the field via the API.
- Then, I upload a CSV file with the data (next step: automation).
The data in the array field looks like this:
["value1", "value2", "value3"]
Hopefully, this solution can help someone else as well!
- Arso3 months agoExpert
Great find! I've used the catalogs API but I haven't tried arrays. Mainly because my clients have had their product databases structured in the way I described above.
Related Content
- 2 years ago
- 2 years ago
- 2 years ago
- 2 years ago