In the example below you will see that I am sending a message to my Sharptools installation.
I have a local variable setup - KitchenStatusMessage. When I set its initial value it works fine. When I try to set it in the rule - you can see that I am getting an errant null in the string.
I have tried deleting the statement, recreating it in a number of ways but can't figure out how to get around this?
I've had to work around this quirk before. Since Rule Machine wants to treat everything between two percent signs as a variable, it thinks you're trying to use a variable called %20is% when it sees the first two percent signs. That variable is null. So
This %20is% 20a%20test
turns into
Thisnull20a%20test
What you need to do is create a local string variable and set it to "%20", then use the variable substitution to insert that into your other variable like this:
I created a variable called "pct20":
Then in the rule I set the variable "test_string" to:
This%pct20%is%pct20%a%pct20%test:
As you can see, that sets test_string to the URL encoded string value that you want.