String Length?

Is there a way to get the length of a string?  I want to get the length of a string so that I can replace the characters for that string with the equivalent number of spaces in a larger string.  As an example:  My have a string that says “Lead: %LeadString% Resource: %Resource%”.  When one line has the same %LeadString% value as the previous line, I want to replace “Lead: %LeadString%” with spaces in the second line.   Of course, %LeadString% can vary in length, so I need to get the length of it before I can replace it.

I cannot figure out a way to do it, though.

Hi Jonathan,

Thanks for contacting us.

Good news on the issue your seeing. This can be done in javascript through the scripting on the actions, or a script actions.

The javascript to get a variable length is simply to use the “length” function off any string. This will return the length of that string which you can assign to a variable. The code for this is like so;

FBVariables.MyVariableLength = FBVariables.Blah.length;

You can place this javascript into any script event. The value will be available after the script event has run.

Thank you for this solution. This actually opened up the door to how to use the scripting, and that is proving to be very useful.