Am I misunderstanding how filters work for Plasmic CMS data?

Hi

I wonder if I am fundamentally misunderstanding how data filters work on Plasmic CMS data?

I have a Plasmic CMS with 2 models: product and product_types. product_types model has a single text field and allows me to build up a consistent list of Product Types.

product model includes fields for name, image, etc. and also a ref field which references the product_types model. This allows me to select one Product Type for each product, from the options defined in product_types model.


On my page I have 3 CMS Data Fetcher components. Each instance pulls in data from the product model and my intention is to filter each instance by the value of the productType field which, as explained above, references the product_type model.

I have set the filters for each instance to match one of the 3 text strings stored in the product_type model:

I have 3 entries in product model all have a productType of Landscape Poster. My expected result would be:

  • all three products rendered by the CMS Data Fetcher component with filter: $props.productType === 'Landscape Poster'
  • no products rendered by the CMS Data Fetcher component with filters: $props.productType === 'Portrait Poster' and $props.productType === 'Other'

The actual result is all products rendered by all 3 CMS Data Fetcher components.

Hi! You are close.

The filter value should be the literal value that you want to filter that field to, so you would actually write the id of the model that you want to filter to, it should be some text that looks like mxijr21y77fkyq2.

(Currently it’s a dynamic value that is going to return either true or false, which doesn’t make sense in this case - remove the dynamic value and just write the ID as text into the input field)

We will work on making this easier to use, but sharing this in case it unblocks you for now!