Skip to main content
JayS
Helper ⭐️
Jun 21, 2022 3:18 PM UTC
Solved

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

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.

Gainsight Employee ⭐️
Jun 22, 2022 5:56 PM UTC

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

Gainsight Employee ⭐️
Jun 21, 2022 5:32 PM UTC

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

Translate
JayS
JaySAuthor
Helper ⭐️
Jun 22, 2022 2:58 PM UTC

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

Translate
Jay Sherwood
Gainsight Employee ⭐️
Jun 22, 2022 5:56 PM UTC

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 

Translate