How do i replace spaces in a link with %20. - InfoPath Dev
in

InfoPath Dev

How do i replace spaces in a link with %20.

Last post 05-12-2015 01:37 PM by smonczka. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-12-2015 10:22 AM

    How do i replace spaces in a link with %20.

     I have an InfoPath from created from a SharePoint list.  This list is populated by someone uploading a document to a library and entering in the documents metadata.  When they save the metadata in the library a workflow populates an item in the list.  One of the fields it populates in the list is a link to the document.  The user opens the list item, checks the document metadata that was added and then can click on the link to see the document.  The issue is that the hyperlink will not work.    Hyperlink in the form when the list item is opened up is... /sites/vendor/invoices/ABC Resellers/123456.txt.  BUT SharePoint is looking for "/sites/vendor/invoices/ABC%20Resellers/123456.txt".  The link in the InfoPath forms is missing the %20 where the space is.  How do I replace all spaces with %20?

    This seems to be a common problem, I've found references to it in several forums but no answers as to how to fix it.

    Thanks

     

     

     

  • 05-12-2015 10:42 AM In reply to

    Re: How do i replace spaces in a link with %20.

    Hello,

    How about adding a Fx to your link with the function translate(field, ' ', '%20') ?

    You can add a rule to the repeating control. And, it should fire when the secondary data source gets loaded. Just go to the data source, select the repeating group in your data fields and add the rule there. You could simply add the rule to the link and have it replace, but be careful because it will continue firing so you'll need to set some other condition so that it only fires once.

    If that doesn't work, then I would suggest you to use qRules 'encode' command. That will definitely do the trick.

    Hope this helps. Thanks!

    - Prachi   

  • 05-12-2015 01:37 PM In reply to

    Re: How do i replace spaces in a link with %20.

     Prachi, Thank you very much for the quick response.  I tried your fix.  By the way I'm not dealing with a repeating table, just a single hyperlink control.  I created a On Load rule that said, ON OPEN a secondary field = translate(hyperlinkfield, ' ', '%20').  It does alter the link but the problem is that it replaces the space with a single '%' NOT %20. 

    Any idea why?

    P.S. we use qRules with several of our clients and it works great, but would not be a fit for this client.  they are very... how do I put it, budget aware.   

     

     

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.