Expand my Community achievements bar.

Latest Community Ideas Review is Out: Discover What’s New and What to Expect!

Trim a Name to get a Variable

Avatar

Level 3

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. 

5 Replies

Avatar

Level 4

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.

Avatar

Community Advisor

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

Avatar

Level 3

I tried that and it didn't seem to work. Did I not set it up correctly? 2023-04-29_14-47-02.png2023-04-29_14-56-48.png

Avatar

Community Advisor

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.