You can show or hide a field on a pass based on a condition. You write the condition with the syntax below, and Passcreator checks it when it creates or updates the pass.
Edit the field in the template editor and open Extended options. Enter your condition in the condition field.
Conditions tolerate small differences. Extra spaces around an operator are fine, and you can wrap a string in single or double quotes.
Combine conditions with &&. The next example matches when the level is Silver and the interest contains food or travel.
{Level} == Silver && {interest} |= food,travel
Enter the placeholder on its own to show the field only when the property is not empty.
{Fieldname}
That is the same as comparing it to an empty string.
{Fieldname} != ''
Show the field only when a property holds a certain value.
{Level} == 'Silver'
Show the field only when a property does not hold a certain value. Both lines below do the same thing.
{Level} != 'Silver'
{Level} <> 'Silver'
Use |= to match when the property contains one of several values. Separate the values with a comma. The next condition matches when the field contains food or travel or both.
{interest} |= food,travel
The now() function checks the moment the pass was created or updated. A phone that receives an update recreates the pass, and that is when Passcreator checks the condition again.
The next condition adds the field only for passes generated after 15 October 2023 at 15.00 and before 31 December 2023 at 23.59. Anyone who downloaded the pass outside that window does not see the field. Send an update on 1 January 2024 and the field drops away.
now() > 2023-10-15 15:00 && now() < 2023-12-31 23:59
Show a field only in Apple Wallet on iOS.
{operatingSystem} == 'iOS'
Show a field only on Android phones.
{operatingSystem} == 'Android'