Solved

URL column with commas in file name

Posted on 2013-02-05
4
919 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

If you create your solutions on SharePoint sooner or later you will come upon a request to set  permissions of the item depending on some of the item's meta-data - the author, people assigned as approvers, divisions, categories etc. The most natu…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

749 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