Notification variable helpers/conditional statements (if/else)
J
Joris Pelgröm
We would like support for simple conditional statements (if/else) in notification messages to add some info depending on the source system data, like whether or not the employee receives a phone.
The variable syntax ({{ }}) looks like Handlebars syntax but the Handlebars helper did not work ( {{#if Person.PrimaryContract.Custom.hardwareTelefoon}}✅{{else}}❌{{/if}}).
J
Joris Pelgröm
Rick van den Dijssel We ended up doing something similar like that, yes, by manipulating the value returned from our source system in the field mapping to have it be empty/null in some cases.
The request still applies - if this was possible we could e.g. include information about the phone in the employees' welcome email only if they receive a phone (so a paragraph or two of text, not the variable value).
R
Rick van den Dijssel
Joris Pelgröm Currently we only support to set an alternative when a attributes value is empty. But I think in your case this should be enough. As example what you could do is the following:
{{Person.PrimaryContract.Custom.hardwareTelefoon||"No phone"}}
This will print out the value of hardwareTelefoon or when empty No phone. It's possible to have multiple variables like this chained:
{{Person.PrimaryContract.Custom.hardwareTelefoon||Person.PrimaryContract.Custom.businessPhone||"No phone"}}