Appearance
Find Object Mutation ​
The Find object mutation picks the first object in a list of objects whose attribute matches a condition. The result is that single object, or an empty value when nothing matches. Follow it with Extract attribute to read an attribute of the found object.
Options ​
- Attribute: The attribute to check on each object. Use dot paths for nested attributes and [0] to pick an entry of a nested list, for example images[0].url.
- Condition: equals, includes, starts with, ends with, empty, not empty, greater than or less than. Text conditions are case-insensitive unless case sensitivity is enabled. Greater than and less than compare numbers, and an attribute that is not a number never matches.
- Value to match: The value the attribute is compared against. This can be a fixed value or a product field.
Example ​
The extra field videos holds this list of videos, parsed with Parse JSON:
json
[
{ "name": "lifestyle.mp4", "url": "https://cdn.example.com/lifestyle.mp4" },
{ "name": "hero.mp4", "url": "https://cdn.example.com/hero.mp4" }
]Find object with attribute name, condition starts with and value hero returns the second object. Adding Extract attribute with attribute url then gives https://cdn.example.com/hero.mp4.