Any Text Magicians Out There?

Hi All.

I have a data set with a ragged and or variable hierarchy and need to produce a nice neat “Hierarchy 1/ Hierarchy 2 / Hierarchy 3” text string in which each lower hierarchy value can come back empty.

I want to do is take all the constraints that I use in a search in which I use ignore empty constraints, and put them in string and have the empty constraints not just be blank but also take their corresponding “ / “ with them when they do.

The actual variable string will have to look like the following.

Category Option/Skills Option/ H&E topic / SubSkill

Examples of results would be:

  • Category 1
  • Category 1/Skills Option A
  • Category 1/Skills Option A/SubSkill (b)
  • Category 3/H&E Topic

What I want to the string to do is basically do deliver a blank AND remove the “ / “ that goes with the empty constraint (all of the above options are potential constraints that can be ignores in a search)

As it stands now, the only way I can see to achieve this is by writing out a set of 9 tediously long boolean conditions to deliver on this. I thought that there might be someone clever than me out there that has found a better way to do this.

Thanks in advance for the help.

Can you add a screenshot of some sample data? Is it currently in a single text field on an object etc?