Skip to content

Count Objects Mutation ​

The Count objects mutation returns the number of objects in a list of objects. It works like Length on a plain list.

Options ​

This mutation has no options.

An empty list gives 0. Count objects needs a list of objects; a single JSON object is not a list.

Example ​

The extra field videos holds this text:

json
[
  { "name": "hero.mp4", "url": "https://cdn.example.com/hero.mp4" },
  { "name": "lifestyle.mp4", "url": "https://cdn.example.com/lifestyle.mp4" }
]

After Parse JSON, Count objects gives 2. Combine it with a rule to add a custom label only to products that have at least one video.