3

I know the following is possible in Apex, but I'm wondering whether there's a way to do it with standard formula fields.

Is there a way to split up a value and wrap each bit in other text values? For example (not a real example:

Custom_Field_1 = 'This;That;Other;', but could have any number of terms.

Formula for Custom_Field_2 should wrap each term delimited by ; in <p></p> and remove the ; to result in <p>This</p><p>That</p><p>Other</p>.

2
  • Is this for the missing feature of frequency reporting for Multi Select Picklists by any chance? Using this formula, or something like it, may make it easier to export to excel and do pivot tables to do the reporting.
    – JodieM
    Commented Aug 10, 2012 at 9:25
  • @David great edit
    – Benj
    Commented Aug 10, 2012 at 18:51

1 Answer 1

9

A basic solution for the formula would be

'<p>' &  SUBSTITUTE(Custom_Field_1, ';', '</p><p>')   & '</p>'

You can add logic to test if Custom_Field_1 is blank and leave the formula field blank in that instance too if necessary.

1
  • Clever work-around!
    – Benj
    Commented Aug 10, 2012 at 16:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .