Solved

URL column with commas in file name

Posted on 2013-02-05
4
876 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
ID: 38855989
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
ID: 38856113
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
ID: 38856126
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
ID: 38856392
Thank you, that worked wonderfully.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary In SharePoint 2010 it is easy to create custom color themes to jazz up a site. Theme colors can also be created in PowerPoint 2010 with a few clicks. But how do the chosen colors actually look in the SharePoint site? The attached PowerPoint…
The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

26 Experts available now in Live!

Get 1:1 Help Now