Skip to main content
Solved

Using signature variables as conditions

  • October 27, 2023
  • 3 replies
  • 173 views

samsheridan
Forum|alt.badge.img+6

We’re looking to use signature templates with custom variables, but can’t find a syntax to add a constant string only when a variable is populated. Front’s variable syntax resembles Twig, but it doesn’t seem to be compatible.

 

If a title exists, we want:

{{user.name}}, {{user.custom.title}}

If no title exists, we want:

{{user.name}}

Not:

{{user.name}}, 

 

Same thing for phone numbers. Bonus points if you can tell me syntax to conditionally include a carriage return.

 

This sample {{recipient.first_name | 'there'}} from the article gives me hope that it’s possible, but we need the opposite (text if exists) or to be able to inject a variable between strings. This is what I really want to do:

{{user.custom.direct} ? ‘Direct ’ + {user.custom.direct} : ‘ | ’}Main 555-555-5555

Best answer by justin

Hi!

Justin here with the support engineering team 👋

As it turns out, this feature is not currently available in Front, BUT I’m still very happy you reached out about it. I'd be happy to pass this along to our Product team and file it as a feature request. 

Perhaps there's a workaround that could get similar results by placing the comma in the comma in the user.custom.title custom field value. For instance:" , Assitant to the Regional Manager". 

In this implementation, you could then place the variables next to one another like so:

{user.name}{user.custom.title}

This would result in the following:

Dwight Schrute, Assitant to the Regional Manager

If no custom field exists for the variable, no text should populate, leaving just the name. 

 

If there are any other questions, please do not hesitate to reach out!

3 replies

justin
Forum|alt.badge.img+8
  • Fronteer
  • Answer
  • October 27, 2023

Hi!

Justin here with the support engineering team 👋

As it turns out, this feature is not currently available in Front, BUT I’m still very happy you reached out about it. I'd be happy to pass this along to our Product team and file it as a feature request. 

Perhaps there's a workaround that could get similar results by placing the comma in the comma in the user.custom.title custom field value. For instance:" , Assitant to the Regional Manager". 

In this implementation, you could then place the variables next to one another like so:

{user.name}{user.custom.title}

This would result in the following:

Dwight Schrute, Assitant to the Regional Manager

If no custom field exists for the variable, no text should populate, leaving just the name. 

 

If there are any other questions, please do not hesitate to reach out!


samsheridan
Forum|alt.badge.img+6
  • Author
  • Helper
  • October 30, 2023

@justin thank you! That was the best workaround we were coming up with too. It works alright except for custom fields synced from clean data in Entra ID. Our short term plan is to just make sure everyone has the fields populated!


hanna_parker
Forum|alt.badge.img
  • Conversationalist
  • October 31, 2023

Thank you~