Skip to main content
Solved

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

  • June 21, 2022
  • 3 replies
  • 140 views

JayS

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

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: https://share.getcloudapp.com/xQuwn2vE 

3 replies

Forum|alt.badge.img

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: https://share.getcloudapp.com/z8umPJOv . 

User/account model support document: https://support.gainsight.com/PX/API_for_Developers/01About/User_and_Account_Model#Custom_Attributes


JayS
  • Author
  • Helper ⭐️
  • June 22, 2022

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}}?

Jay


Forum|alt.badge.img
  • Gainsight Employee ⭐️
  • Answer
  • June 22, 2022

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: https://share.getcloudapp.com/xQuwn2vE