0

OpenURL and parameters being replaced

Hi, I am trying to pass two fields to a URL as parameters, then use a button to open that in a new browser window.

I have a formula to generate the following link which works correctly:

https://www.examplewebsite.com/example/ExampleFunction?entry={%22CustomerPhone%22:%225554443333%22,%22CustomerFirstName%22:%22Test%22}

Where (555) 444-3333 is the customer's formatted phone number, and Test is the customer's first name.

 

When I just paste that link in my browser using the real website, it works perfectly.

 

However, when I click the button in Ninox, I get this link:

https://www.examplewebsite.com/example/ExampleFunction?entry=%7B%2522CustomerPhone%2522:%25225554443333%2522&%7B%2522CustomerFirstName%2522:%2522Test%2522%7D

 

Ninox is replacing { with %7B% with %25, and } with %7D.

 

How do I fix this?

 

Here's my code: 

Where Phone is stored as (123) 456-7890

let PhoneNoLParenth := replace(Phone, "(", null);
let PhoneNoLRParenth := replace(PhoneNoLParenth, ")", null);
let PhoneNoSpace := replace(PhoneNoLRParenth, " ", null);
let UnformattedPhone := replace(PhoneNoSpace, "-", null);
let TextURL := "https://www.cognitoforms.com/Doorstep1/TextMessageSender?entry={%22CustomerPhone%22:%22" +
    UnformattedPhone +
    "%22&{%22CustomerFirstName%22:%22" +
    'First Name' +
    "%22}";
openURL(TextURL)

Reply

null