App reviews, troubleshooting, and recommendations
Hi,
I want to query a Customer filtered by it's metafield key/value. How can I achieve this?
Hi @Lederer,
You can filter metafield with namespace and key, you cannot filter using value of metafield.
Query:
query Customer_Data{
customers(first:10){
edges{
node{
email
displayName
metafield(namespace:"custom", key:"xyz"){
id
namespace
key
value
}
}
}
}
}
Thanks....
-message deleted-
Hey, thanks for your answer. But this query will not filter the results. It just includes the metafields for all customers.
I found a way:
query MyQuery {
customerSegmentMembers(
query: "metafields.custom.dados_fiscais = '03305273127' "
first: 10
) {
edges {
node {
id
}
}
totalCount
}
}
Does no one know a solution?
I do.
query MyQuery {
customerSegmentMembers(
query: "metafields.custom.dados_fiscais = 'value-metafield-here' "
first: 10
) {
edges {
node {
id
lastName
firstName
note
}
}
totalCount
}
}
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025