If in array

Conditionally merges different content depending on whether a list of values contains a particular value. Use it when a field holds several values at once, such as selected interests or chosen devices.

Syntax

{{#ifInArray data value}}true content{{else}}false content{{/ifInArray}}

Parameters

Name Type Required Description
Data Text Required The list to search, written as a JSON list, for example ["mobile","tablet"].
Value Text Required The value to look for in the list.
Note: The comparison ignores capitalization, so "mobile" and "Mobile" both match. If the data is not a JSON list, the false content shows.

Examples

The examples below are based on a contact whose interests field holds ["running","cycling"].

A. Looking for a value that is in the list

{{#ifInArray Contact.interests "cycling"}}See our new bikes.{{else}}See what is new.{{/ifInArray}}
See our new bikes.

B. Looking for a value that is not in the list

{{#ifInArray Contact.interests "swimming"}}See our new goggles.{{else}}See what is new.{{/ifInArray}}
See what is new.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us