3

I am attempting to include a value in a cloud data extension using a smart capture form and AMPscript. The value is a Hashed ID which is included in the email using AMPScript.'%%=v(QueryParameter('Id'))=%%' as value in the form field.

The solution works fine except for when the hashed ID includes a '+'symbol. In the data extension the + is transefered in a ' ' or enter.

e.g.:

0V7R3CB8xcHPdM/OQCyEZTvhDU+dEeKowSU=

turns into:

0V7R3CB8xcHPdM/OQCyEZTvhDU dEeKowSU=

Is there a way to include the full hashed ID in the data extension using this solution? I have tried putting the hashed ID between "'which did not work.

  • I had the same problem last week. I used SQL to replace ' ' with '+' – user3276533 Jun 18 '18 at 19:37
  • Thank you for your input. Did you experience this with any other characters or was it only the '+'? – user1122843 Jun 18 '18 at 20:37
2

I believe the issue is that it is being URL encoded, in which '+' is equal to ' ' (same as '%20').

I would look at utilizing URLENCODE() function (Not recommended, but easiest to implement. May cause issues as encoding is automatic) or a replacelist() function to change the spaces back to plus signs (my recommendations as it is fully customizable) when pulling in the email.

I say replacelist() instead of replace() as replace() will only affect the first match, where replacelist() will affect every match.

example of code on Email:

%%=ReplaceList(QueryParameter('id'), "+", " ")=%%

| improve this answer | |
  • Thank you for you quick answer. Where would you place the replacelist() function typically? Can I include it in the %%=v(QueryParameter('Id'))=%% function? – user1122843 Jun 18 '18 at 21:55
  • In the email call - I have added context and a sample in my answer – Gortonington Jun 18 '18 at 21:59
  • 1
    Brilliant! That is the solution. Thank you for your help. – user1122843 Jun 18 '18 at 22:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.