Skip to content

Show a field only if it matches a condition

Visibility conditions show or hide a field or the barcode based on a condition you define. Use them for a VIP message that only gold members see, a promo line that appears only during a campaign, or a hint that only Android users need.

Adding a condition

  1. Open the template editor and edit the field in Frontfields or Backfields. The barcode in Barcode & NFC has the same option.
  2. Enter your condition in Condition for Visibility.
  3. Save and publish the template.

Passcreator adds the field to a pass only when the condition matches for that pass.

Conditions are fault tolerant to a certain degree. Whitespace around operators doesn't matter, and you can enclose strings in double or single quotes. Combine several conditions with the && operator.

{Level} == Silver && {interest} |= food,travel

Condition syntax and examples

Show a field if an additional property is not empty

Enter the placeholder on its own.

{Fieldname}

This is the same as comparing it to an empty string with {Fieldname} != ''.

Show a field if a property has a certain value

{Level} == 'Silver'

Show a field if a property does not match a value

{Level} != 'Silver'

<> works the same as !=.

Show a field if a property contains one of several values

The |= operator matches if the property contains at least one of the values separated by commas.

{interest} |= food,travel

Show a field based on the time of pass creation

The now() function evaluates the time when Passcreator creates or updates the pass. This example adds the field only to passes generated between October 15 and December 31, 2023.

now() > 2023-10-15 15:00 && now() < 2023-12-31 23:59

Show a field based on the operating system

Show a field only in Apple Wallet on iOS.

{operatingSystem} == 'iOS'

Show a field only on Android phones.

{operatingSystem} == 'Android'

Tips

Next step

Continue withPersonalization and additional properties

Checked 2026-08-20 · Documentation