Share feedback, ideas and get community help

Updated 4 months ago

Client Side {{variables}}!!!!

At a glance

The community member is having an issue with passing a variable to a client-side script. When they try to use the variable {{TestId}} in the script window.progress.add({ id: "{{TestId}}" });, they get an unexpected string vl6402idq2k63zn3q99rhp2ho instead of the expected value. However, when they use a hardcoded string window.progress.add({ id: "ABC123" });, it works as expected.

In the comments, a community member suggests that the issue can be solved by setting the proper escape and setting the variable outside the block, like this: window.progressier.add({ id: {{TestId}} });. Another community member recommends making sure the variable and the script are set to "execute on client".

There is no explicitly marked answer in the post, but the comments provide a potential solution to the issue.

If I have a client side script and I set a variable, lets call it {{id}} when I pass that variable like this in an APP client side.

On the client I run the script

Plain Text
window.progress.add({
  id: "{{TestId}}"
});

The results is: vl6402idq2k63zn3q99rhp2ho ( what is that? It looks like the variable id or sometyhing.)

Also if I just use text and no variable it works fine and the results are as they should be. Like...

Plain Text
window.progress.add({
  id: "ABC123"
});


Can I not pass a variable to the client browser? Is this a bug? I figure I should be able to pass that when the page loads just fine but I keep getting this odd string.
C
2 comments
I solved this by setting the proper escape.

Set thge var outside the block then set the var like this

Plain Text
window.progressier.add({
  id: {{TestId}}
});
make sure you are setting the "execute on client" for both the var and the script.
Add a reply
Sign up and join the conversation on Discord