Share feedback, ideas and get community help

Updated 5 months ago

Use a variable into a JScode SetVariable Block

At a glance

The community member needs help extracting a CPF number (11122233344) from a text example and setting it as a variable, but they are encountering an error when using a variable instead of manually entering the text. The comments explain that variables in scripts are not parsed, but evaluated, so the variable needs to be used without quotes to properly get the content value. A link to documentation on setting variables is provided.

Useful resources
I need a expert help with what I need

On this text example :
Informações adicionais:\n\nCPF: 11122233344\nCelular / WhatsAppp : +5565992560189

I need extract the CPF number, in this case 11122233344 and set this as a variable to use, but this just work if I but manualy the text inside de jscode, using a variable give error
Attachment
image.png
B
m
3 comments
Variables in script are not parsed, they are evaluated. So it should be treated as if it were real Javascript variables.

So, if you write "{{My variable}}", it will parse the variable ID (something like vclfqgqkdf000008mh3r6xakty). You need to remove the double quotes to properly get the variable content value.

For example,

"{{URL base}}/path" => vclfqgqkdf000008mh3r6xakty/path
{{URL base}} + '/path' => https://domain.com/path
${{{URL base}}}/path => https://domain.com/path
Thanks so much...
Add a reply
Sign up and join the conversation on Discord