Solved

URL column with commas in file name

Posted on 2013-02-05
4
857 Views
Last Modified: 2013-02-05
I have an InfoPath form that saves with a concatenation of a company name and a date.  

There a a few workflow's with tasks that get linked to it.  However when the company has a comma in the name it breaks the link into the description.  

What is the best way to replace the comma with a space or underscore in InfoPath 2010?

Example:
ABC Company, Inc - 2/5/2013
It will break on the comma into:
link: ABC Company.xml
Desc: Inc - 2/5/2013
0
Comment
Question by:difisolutions
  • 2
4 Comments
 
LVL 9

Expert Comment

by:kukdai
Comment Utility
try using %2c in case of comma that is encoded value of comma.
try if this works.
0
 
LVL 28

Accepted Solution

by:
clayfox earned 185 total points
Comment Utility
In InfoPath you would use the translate function.

You could replace commas with whatever you want including the %2c, but that would make it less readable for humans.

if field is CompanyName
use a setfieldvalue action to set CompanyName with
translate(CompanyName, "QWERTYUIOPASDFGHJKLZXCVBNM. qwertyuiopasdfghjklzxcvbnm,", "QWERTYUIOPASDFGHJKLZXCVBNM. qwertyuiopasdfghjklzxcvbnm_")

That should keep all capitals and lowercase characters unchanged. Also added a period and a space, but then the last , will be replaced by a underscore.  You could also remove the underscore and commas will be translated to nothing, effectively removed from the string.
0
 
LVL 28

Expert Comment

by:clayfox
Comment Utility
If you wanted to replace one character with many another method is to use substrings.

concat(substring-before(CompanyName, ","), "%2c", substring-after(CompanyName, ","))

This would work for one comma in the string, it gets harder if there are multiple, but you could have multiple rules that if substring-before(CompanyName, ",") is not blank, then run the same action again.  Add three or four of these rules depending on how many you anticipate.
0
 

Author Closing Comment

by:difisolutions
Comment Utility
Thank you, that worked wonderfully.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
Before you can digitally sign infopath forms, you must have a digital certificate. Microsoft Certificate Services will need to be enabled on a Windows Server 2008 to facilitate the creation and verification of the digital certifciates on the web ser…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now