Skip to main content

I am attempting to avoid having several lengthy branches within a workflow. What I need is to take a firstname.lastname value and if it is over 20 characters long substring it to cut off after 20 characters. 

 

Below is the function I have so far but this only works when the character limit is over 20, I cannot find a solution to keep the characters the same when it is under 20 characters:

 

if (length('{{E17.result}}')>20, substring('{{E17.result}}',0, 20), substring('{{E17.result}}', 0, 20))

I have tried many variations like the one below but still have not been able to accomplish this. 

if (length('{{E17.result}}')>20, substring('{{E17.result}}',0, 20), {{E17.result}})

 

Typically I will get this error: Invalid Syntax - Third operand's value must be <= first operand's length.

 

The end goal is to get this value for both manager name and new hire name so that I can plug this in further down the workflow and always have the correct character limit rather than have 4 lengthy branches for needing to substring and not needing to substring. 

I was able to find a solution to my problem with the use of truncate:

 

{{E39.result | truncate: 20, "" }}


Reply