Insert default if PX token is blank/null? (e.g. {{user.FirstName}})

  • 21 June 2022
  • 3 replies

Userlevel 3
  • Team Captain
  • 56 replies

If I use the token for user first name {{user.FirstName}} in an engagement or email, what happens if the field is blank/null? Can I insert a default if it is? 

If my first name is populated, the email would show “Dear Jay,”

If my first name is blank/null, the email would show “Dear Valued Customer,”


Also, is there any way to insert a default if the data is bad/incorrect? For example, some of the first name fields I’m seeing have “FirstName”, “??”, etc.


Best answer by srinivas myakala 22 June 2022, 19:56

View original

3 replies

Userlevel 2

Hi @JayS ,

We have the option to be able to set the default value for custom attributes and this will be used when ever the attribute is used as a token(email engagements) and has an empty value only and the token displays the corresponding value of attribute if its non empty(even if it’s “FirstName”, “??”, etc). Screenshot reference: . 

User/account model support document:

Userlevel 3

Hi @srinivas myakala,

So that would be an additional “FirstName” field that we have to create as one of our custom fields? There’s not a way to insert a default using the token {{user.FirstName}}?


Userlevel 2

Hello @JayS ,

Yes, we can set the default value for the standard attributes tokens in email engagements, example: {{User.firstName|Valued customer}}. The default value of the attribute should be placed after the | in the token. Screenshot ref: