Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

URL column with commas in file name

Posted on 2013-02-05
4
Medium Priority
?
1,004 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 740 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

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…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

610 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