'#' Character Breaks Query String

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. 

<br>AccountId={{$Model.Account.data.0.Id}}&amp;MailingStreet={{$Model.Account.data.0.BillingStreet}}&amp;MailingCity={{$Model.Account.data.0.BillingCity}}&amp;MailingState={{$Model.Account.data.0.BillingState}}&amp;MailingPostalCode={{$Model.Account.data.0.BillingPostalCode}}&amp;Phone={{$Model.Account.data.0.Phone}}&amp;MailingCountry={{$Model.Account.data.0.BillingCountry}} 

I think you need to encode your url so it handles the special characters, like a #. This thread may help:

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}}&amp;MailingStreet={{#urlEncode}}{{$Model.Account.data.0.BillingStreet}}{{/urlEncode}}&amp;MailingCity={{$Model.Account.data.0.BillingCity}}&amp;MailingState={{$Model.Account.data.0.BillingState}}&amp;MailingPostalCode={{#urlEncode}}{{$Model.Account.data.0.BillingPostalCode}}{{/urlEncode}}&amp;Phone={{$Model.Account.data.0.Phone}}&amp;MailingCountry={{$Model.Account.data.0.BillingCountry}}

Hi Good day!

I am also facing the same issue, When we are passing the data because of some special characters the is not passing.

Original Query String:

accountSTId={{$Model.dsm_UI_Opportunitydrawer.data.0.TemporarySTID}}&userId={{$Model.dsm_UI_Opportunitydrawer.data.0.userID}}&ruleId={{ruleId}}&ruleName={{ruleName}}&recommendationFlag={{recommendationFlag}}&recommendation={{recommendation}}&evaluationMessage={{evaluationMessage}}&recommendationId={{recommendationId}}&recommendationType={{recommendationType}}&isLightning={{$Model.dsm_UI_Ltng_Ctl_Program.data.0.isLightning}}

Tried Query String:

accountSTId={{$Model.dsm_UI_Opportunitydrawer.data.0.TemporarySTID}}&userId={{$Model.dsm_UI_Opportunitydrawer.data.0.userID}}&ruleId={{ruleId}}&ruleName={{ruleName}}&recommendationFlag={{recommendationFlag}}&recommendation={{recommendation}}&evaluationMessage={{&urlEncode}}{{evaluationMessage}}{{/urlEncode}}&recommendationId={{recommendationId}}&recommendationType={{recommendationType}}&isLightning={{$Model.dsm_UI_Ltng_Ctl_Program.data.0.isLightning}}

example passing data:
I am playing cricket & you can able to play it?

Can anyone please help me with this issue?

1 Like

Hey @Hareeshkommineni and Welcome!

I fixed the link in the older thread that may help(see above), but I will report it here:

Where the input (or a datasource field) needs to be merged into a url, it is recommended to use the merge function like so: {{#urlEncode}}{{address}}{{/urlEncode}}.

The doc for this can be found here.

I hope this helps!

Hi @anon57098112,

I have tried with this query string:
recommendation={{recommendation}}&evaluationMessage={{#encodeUrl}}{{evaluationMessage}}{{/#encodeUrl}}&recommendationId={{recommendationId}}

After passing this query string the data is not passing to the next page.

Could you please help me with this?

Hey @Hareeshkommineni, it looks like you just need to remove the # sign from your second encode URL parameter, and make sure you use {{#urlEncode}} rather than {{#encodeURL}}:

recommendation={{recommendation}}&evaluationMessage={{#urlEncode}}{{evaluationMessage}}{{/urlEncodel}}&recommendationId={{recommendationId}}

Cheers!

1 Like

Hey @Hareeshkommineni just wanted to follow up. Did Anna’s solution resolve your issue?

Hello @anon57098112 @Anna_Wiersema,

Thank you so much for your help!

I made small mistake in code just changed and its working now.

Regards,
Hareesh

1 Like

@Hareeshkommineni That’s awesome.

If you can please make the post as solved, it will help other users find the answer that helped you easier.

Thanks!

1 Like