Remove characters form a string
I am building a field which concatenates a [Work ID] values and [Name of Request] that will be used to name associated files.
Many of the [Name of Request] include characters which are are not allowed in file names (' " / \ # etc.)
How can I replace these characters with an underscore from the string in this formula?
This works for commas..... =[Work ID]@row + " : " + (SUBSTITUTE([Name of Request]@row, ",", "_"))
But, not sure of the syntax to include ' " / \ # ...
This is unpasrable =[Work ID]@row + " : " + (SUBSTITUTE([Name of Request]@row,(",","/",">","." )"_")
Comments
-
I hope you're well and safe!
Try something like this, and continue the pattern.
=[Work ID]@row + ":" + SUBSTITUTE(SUBSTITUTE([Work ID]@row, "/", "_"), "#", "_")
Did that work/help?
I hope that helps!
Be safe and have a fantastic week!
Best,
Andrée Starå | Workflow Consultant / CEO @ WORK BOLD
✅Did my post(s) help or answer your question or solve your problem? Please support the Community by marking it Insightful/Vote Up, Awesome, or/and as the accepted answer. It will make it easier for others to find a solution or help to answer!
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå | Workflow Consultant / CEO @ WORK BOLD
W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35
Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.
-
Thanks @Andrée Starå
I'm not sure I follow the syntax
Do I add a (SUBSTITUTE for each character substitution?
This throws Unparsable
=WorkID]@row+":"+SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE([NameofRequest]@row,"/","_"),"#","_")"#","_"),"%","_"),"&","_"),"{","_"),"}","_"),"\","_"),"<","_"),">","_"),"*","_"),"?","_"),"/","_"),"","_"),"$","_"),"!","_"),"'","_"),""","_"),":","_"),"@","_"))
-
I've found the culprits. I was missing a comma and \ backslash
It fails on backslash "\", "_"
In the forums I read \ is an escape character and it was recommended to use two "\\"
This now works as expected.. Thanks for the help
=[Work ID]@row + "___" + SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE([Name of Request]@row, "/", "_"), "#", "_"), "&", "_"), "%", "_"), "{", "_"), "}", "_"), "<", "_"), ">", "_"), "*", "_"), "?", "_"), "/", "_"), "$", "_"), "!", "_"), "'", "_"), ":", "_"), "@", "_"), "|", "_"), "\\", "_")
-
Excellent!
Happy to help!
✅Remember! Did my post(s) help or answer your question or solve your problem? Please support the Community by marking it Insightful/Vote Up/Awesome or/and as the accepted answer. It will make it easier for others to find a solution or help to answer!
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå | Workflow Consultant / CEO @ WORK BOLD
W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35
Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 437 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!