Dynamic file name creation with formula

Current formula is below. I get an extra hyphen between project name and size if the row is a level 2.or 3. I can't figure out how to not have an extra hyphen. Not sure if I need to add OR statement so it looks at each level then pulls the correct information. The file name should be Job#_Project Name_Size
=IF(Level@row >= "3", INDEX(ANCESTORS([Job #]@row ), 1), [Job #]@row ) + "_" + IF(Level@row >= "2", [Project Name]@row , "") + "_" + IF(Level@row = "1", [Project Name]@row , "") + "_" + [Size (WxH)]@row
Result: PRAFI_001207_DOM25_Breakout01_RetractableBanner__24x81
Best Answer
-
Try moving the last underscore into the IF for level 1:
=IF(Level@row >= "3", INDEX(ANCESTORS([Job #]@row), 1), [Job #]@row) + "_" + IF(Level@row >= "2", [Project Name]@row, "") + "_" + IF(Level@row = "1", [Project Name]@row + "_", "") + [Size (WxH)]@row
Answers
-
Hi,
I hope you're well and safe!
Try changing all the "_" to something else for each so you can easily see where the issue might come from.Make sense?
I hope that helps!
Be safe, and have a fantastic day!
Best,
Andrée Starå | Smartsheet Expert Consultant & Partner / CEO @ WORK BOLD
✅ Did I help answer your question/solve the problem? Please support with💡 ⬆️ ❤️, and/or ✅ Answer. This will make it easier for others to find a solution or help answer! I appreciate it, thank you! 🙏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.
-
Try moving the last underscore into the IF for level 1:
=IF(Level@row >= "3", INDEX(ANCESTORS([Job #]@row), 1), [Job #]@row) + "_" + IF(Level@row >= "2", [Project Name]@row, "") + "_" + IF(Level@row = "1", [Project Name]@row + "_", "") + [Size (WxH)]@row
-
@Paul Newcome Yes that worked perfectly Thanks Paul and Andree always for your insights and quick responses
-
I'm always happy to help!
✅ Remember! Did I help answer your question/solve the problem? Please support with💡 ⬆️ ❤️, and/or ✅ Answer. This will make it easier for others to find a solution or help answer! I appreciate it, thank you! 🙏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
Check out the Formula Handbook template!