Trim a Name to get a Variable | Community
Skip to main content
Level 2
April 24, 2023
Question

Trim a Name to get a Variable

  • April 24, 2023
  • 3 replies
  • 1122 views

I'm sure this is an easy solve but I haven't been able to figure it out yet. I want to take a document name "BB Design Review FPO PROOF" and remove the " FPO Proof" from the name so it only returns the variable "BB Design Review". Goal is to match the name with a matching Workflow Template with the same name.

 

Does anyone know how to do this? I tried using the replace function to replace FPO Proof with a space and then trim that, but it didn't work. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

BrownPaperBag
Level 3
April 27, 2023

Hi Sarah.

 

So many ways to solve a problem - noticing the lack of responses here, I wonder if a zoomed-out view of the end-goal might prompt some more thoughts from the community? 

 

What is the larger picture here, is it just one workflow or many that you are seeking to align?

 

C.

ChrisStephens
Community Advisor
Community Advisor
April 27, 2023

You can replace text with {{emptystring}}, which is essentially deleting text, instead of replacing it with a space.

SarahSm2Author
Level 2
April 29, 2023

I tried that and it didn't seem to work. Did I not set it up correctly? 

ChrisStephens
Community Advisor
Community Advisor
May 1, 2023

Almost, but not quite. Replace is a string-literal search, so the capitalization matters. So in the case you posted, you have "FP0 Proof" being replaced, but in the string it's "FP0 PROOF" (not sure if that's a number 0 or letter O), so as far as the code is concerned it's not replacing anything because the substring isn't there. Changing the replace function to "FP0 PROOF" will work.

SarahSm2Author
Level 2
May 1, 2023

Ah...the details. Thank you, that worked!