Custom Script Converter: What can you do with it?

converter

#1

Hi community!

Following the discussion we had in this thread, I wanted to re-introduce the Custom Script Converter.
Although the help center article gives some examples about how to use it, let’s all share in this thread your tips & tricks where this converter made your life easier.

I’ll start with the one that enables to trim a text on both hands, based on a fixed number of starting & ending characters to remove.

The script below removes the first 10 characters and the last 3 ones. Adapt the figures to your own needs.

var t = INPUT.substring(10);
var t2 = t.substring(0, t.length - 3)
t2

So, what’s your favorite usage of that converter?

PS : don’t forget to check the samples in the help center articles:


Add "Trim" Binding Converter
#2

“If Field is Blank” Converters:

I believe I learned two ways to do this, one from @AlexL and the other from @Mihai I believe:
This one works best for all players, including tablets. (I think android values technically are not ‘blank’, that’s why the one below works best for those)

if (INPUT.length < 1)
false;
else
true;

This works well for windows players

Is Blank for only windows I believe…

if(INPUT=="")
“False”;
else
"True";