Solved

URL column with commas in file name

Posted on 2013-02-05
4
938 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

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…
SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

737 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