'#' Character Breaks Query String

  • 1
  • Problem
  • Updated 2 years ago
  • Solved
I noticed a glitch in my query string passed for creating new contacts. When the billing address has '#' in it, the user gets the "Inked" error message. 

For example, the street address "2799 WEST GRAND BLVD" works fine; however, 430 BEDFORD ST #100 MA does not. And I narrowed the problem down to '#' being the issue.

I've attached my Query string below but does any have suggestions for how I should move forward? I could always put limitations on entry for symbols but i'd like to not limit users whenever possible. 

AccountId={{$Model.Account.data.0.Id}}&MailingStreet={{$Model.Account.data.0.BillingStreet}}&MailingCity={{$Model.Account.data.0.BillingCity}}&MailingState={{$Model.Account.data.0.BillingState}}&MailingPostalCode={{$Model.Account.data.0.BillingPostalCode}}&Phone={{$Model.Account.data.0.Phone}}&MailingCountry={{$Model.Account.data.0.BillingCountry}}
Photo of Erik Wahlberg

Erik Wahlberg

  • 2,156 Points 2k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Chandra V

Chandra V, Champion

  • 6,966 Points 5k badge 2x thumb
I think you need to encode your url so it handles the special characters, like a #.  This thread may help: https://community.skuid.com/skuid/topics/redirect-to-url-with-url-encoding-for-special-characters
Photo of Erik Wahlberg

Erik Wahlberg

  • 2,156 Points 2k badge 2x thumb
This was exactly what I was looking for, thanks for the suggestion! Didnt know where to start with this one but it completely makes sense now.

The updated query string is below
AccountId={{$Model.Account.data.0.Id}}&MailingStreet={{#urlEncode}}{{$Model.Account.data.0.BillingStreet}}{{/urlEncode}}&MailingCity={{$Model.Account.data.0.BillingCity}}&MailingState={{$Model.Account.data.0.BillingState}}&MailingPostalCode={{#urlEncode}}{{$Model.Account.data.0.BillingPostalCode}}{{/urlEncode}}&Phone={{$Model.Account.data.0.Phone}}&MailingCountry={{$Model.Account.data.0.BillingCountry}}