Skip to content

How to add a metadata filter in the filter or search in a Filtered List? #160

@osseonews

Description

@osseonews

We trying to add a Metadata filter to the Customer Search/Filter. We know how to do this with the API to add a filter like below to the request, but how can we add this in the filters list? We read the docs, and the search filter, only accepts one predicate, so we can't add it o the search bar. We tried creating another filter, but apparently you can't have a Search Bar and a filter with a Text Input? Anyway, here is the filter, we are looking to do. We would want a text box in the filter, that would then filter by the metadata last name key &filter[q][metadata_jcont]={"last_name":"OURNAME"}

See below. How do we add the key to search for in the metadata?

 {
    label: 'Last Name',
    type: 'textSearch',
    sdk: {
      predicate: ['metadata'] + '_jcont'
    },
    render: {
      component: 'input'
    }
  },

Thanks.

BTW, the current search predicate in customers is this:
predicate: ['email', 'customer_group_name'].join('_or_') + '_cont' - concatenating the above metadata filter doesn't work, because it doesn't add another filter[q] to the list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions