collectionCreate (Smart Collection) using Send Admin API

Hello All

I am trying to create collection using collectionCreate mutation and I want to publish that collection as well

When product status is updated

{
“input”: {
“title”: “{{product.vendor}} Mens Shocks”,
“handle”: “{{ product.vendor | downcase }}-mens-shocks”
},
“ruleSet”: {
“appliedDisjunctively”: false,
“rules”: [
{
“column”: “TAG”,
“relation”: “IS EQUAL TO”,
“condition”: “{{product.vendor}} Mens Shocks”
}
]
}
}

When I use this it creates a manual collection and does not add the products to the collection or publish the collection

I want to makes 100s collections using flow

Here is what I have done but when I used collectionCreate mutation using Send Admin API request

It creates a manual collection and rules provided in collectionCreate does not added when collection is created

Try running the query in graphiql first. There was a parse error in your json input:

Also be sure to include userErrors in your query:

{
  "input": {
    "title": "Mens Shocks",
    "handle": "vendor-mens-shocks",
    "ruleSet": {
      "appliedDisjunctively": false,
      "rules": [
        {
          "column": "TAG",
          "relation": "EQUALS",
          "condition": "Mens Shocks"
        }
      ]
    }
  }
}

For Flow + collectionCreate: ruleSet must sit inside input, and relation should be EQUALS (not “IS EQUAL TO”). That gets you proper smart collections; publishing is a separate publishablePublish step.

If you’re creating hundreds from tags/vendors and don’t need Flow, I built Collectify – Auto Collections to bulk-create those smart collections from existing catalog attributes (disclosure: I’m the developer). Free for 10, then $5 one-time. Search “Collectify” in the App Store.