Spaces in url

M

mbrassel

Hi, can we please get help with the translate function.

Here is what our translate function looks like:
translate(concat(field1, " ", field2), " ", "%20")

Unfortunately, this replaces the space with a % but for some reason drops
the 20. Consequently, when it goes into a browser, the % gets replaced with
a %25.

We are using Office/InfoPath 2007 and WSS 3.0.
 
G

Greg Collins

The translate() function works on a one-by-one character replacement. Thus
the " " gets replaced with the "%" only.

You will need to use something more complex (code) to accomplish what you
want.

Your construct is kind of weird too:

translate(concat(field1, " ", field2), " ", "%20")

Because the concat() happens before the translate() the space you are adding
between the fields is going to get translated too.

Maybe you meant:

concat(translate(field1, " ", "%20"), " ", translate(field2, " ",
"%20"))

If not, then why not just:

concat(field1, "%20", field2)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top