Solved

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

  • 21 June 2022
  • 3 replies
  • 103 views

Userlevel 4

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.

icon

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

View original

3 replies

Badge

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

Userlevel 4

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

Badge

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 

Reply