Passing cmd_var1 with ampersand

I need to open an URL like this:
https://www.traghettilines.it/resultsconfronto.aspx?Pdestinazione=16&Pdata=22/08/2024&Ptratta=405&UAID=20

Parameters after …aspx? are necessary to bypass the first page of the booking process.
When I pass the URL via internal variable Cmd_Var1, parameters after “Pdestinazione=16” are ignored. I assume the issue arises from the use of “&” (ampersand), which serves as a command line joiner in UIV. I attempted to replace “&” with “& amp;”, but it was unsuccessful.

Which syntax should I use?

Thank you for your help.

Original URL: https://example.com/search?query=cat&dog
Escaped URL: https://example.com/search?query=cat%26dog

1 Like

I’ve discovered a workaround: in my Cmd_Var1, I use “$” instead of “&”, and then replace it again using:

{
“Command”: “times”,
“Target”: “7”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: “return ${ScURL}.replace("$", "&")\n”,
“Value”: “ScUrl”,
“Description”: “”
},
{
“Command”: “end”,
“Target”: “${ScUrl}”,
“Value”: “”,
“Description”: “”
},

…but I guess there a Syntax to avoid this problem at root

1 Like

It works!
Thank you!