I am writing an app for SmartThings (www.smartthings.com) in their own IDE. I have an input field here that is supposed to be text input. I ask for a departure address:
section("Departing From:"){
input "departFrom", "text", title: "Address?"
}
when putting in the value of Monterey, CA
the value magically gets changed to a JSON Array with the values of [Monterey, CA]
I want to pass this value to an httpGET
statement but I need to URLencode
it first to omit spaces, etc.I have tried URLencoder
with no success due to the JSON array.
I have tried join(",")
with no luck as it adds double quotes to the value.
How can I get a clean Monterey%2C%20CA
URL encoded value from this variable?
** bear in mind someone could input any combination of numbers, spaces, and commas into this input as an address. The mapquest API I am sending it to can handle all these things as long as they dont have special characters and spaces are URL encoded.