Jump to content
  • 0

Send parameters with # sign


Hayley

Question

We have a datapage that sends a set of parameters to another datapage via a URL query string. This works well, except when a parameter contains a '#' symbol, which blocks the value that follows this in the URL from being received. 

Do you have any way of sending values containing the "#" symbol? Thanks in advance.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1
On 7/28/2021 at 9:32 AM, LittleMsGinger said:

Hello Hayley,

You can add a field either Calculated Field or Calculated value to replace '#' in the value to URL encoded character '%23'

replace([@field:FIELDNAME],'#','%23')
 
Then, pass this value as parameter. 
 
You can also hide this calculation, so it will not be visible in the form. 
 
Hope this helps.

Hi!

Just to add on this, I have found a documentation containing the list of URL encoded characters that you can use as a reference: https://www.degraeve.com/reference/urlencoding.php

Link to comment
Share on other sites

  • 0

Hello @Hayley, you can use a JavaScript function to encode the string. Below is the sample code. You can input this code into your HTML block where you want to define your link.

<script>
document.write("<a href='mysite.com?param='" + escape('[@field:FN]') + ">link</a>") ;
</script>

You can also check the references below:

https://stackoverflow.com/questions/2828211/how-can-i-include-special-characters-in-query-strings
https://www.w3resource.com/javascript/functions/encodeURIComponent-function.php
https://forums.caspio.com/topic/9278-passing-field-values-with-ampersand-over-query-string/

-PotatoMato

Link to comment
Share on other sites

  • 0

Hello Hayley,

You can add a field either Calculated Field or Calculated value to replace '#' in the value to URL encoded character '%23'

replace([@field:FIELDNAME],'#','%23')
 
Then, pass this value as parameter. 
 
You can also hide this calculation, so it will not be visible in the form. 
 
Hope this helps.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...