Forum Discussion

GeorgeKhairalla's avatar
GeorgeKhairalla
Qrew Cadet
3 years ago

Convert a TextList field into richtext bulleted list

Hi, I'm not sure if there is an easy way to do this?
I have a multi-select field that has 3 possible values:
- Password Reset
- Data Backup
- Data Restore

I'm working on presenting this in a RichText Formula field, and to separate the values into a bulleted point list.
I have tried many variations of List/Split/ToText in this formula, but the best I could get is a basically a "string version" of the same list separated by ";"

My attempt in the below code is to list the items and use an HTML <br> +  an ASCII of the Bullet to mimic a bulleted list.

var text ITADDITIONALPRIV = 
"<tr><td>" &
List("<br />&#8226",(ToText([IT Contact Extra Privileges])),"") &
"</td></tr>";


Is there a way to do this?

Thanks!



------------------------------
George Khairallah
------------------------------

7 Replies

  • I haven't done this in a while, but on my cheat sheet i have the following (I bet there is a much easier way than this but....at least it's something). This allows your combined text to have up to 8 parts, you have to expand for more.

    var text Field = ToText([Combined Text Field); //Field with list for bullets
    var text Delineator = ";"; // How is your text field separated?

    var text PartOne = Trim(Part($Field,1,$Delineator));
    var text PartTwo = Trim(Part($Field,2,$Delineator));
    var text PartThree = Trim(Part($Field,3,$Delineator));
    var text PartFour = Trim(Part($Field,4,$Delineator));
    var text PartFive = Trim(Part($Field,5,$Delineator));
    var text PartSix = Trim(Part($Field,6,$Delineator));
    var text PartSeven = Trim(Part($Field,7,$Delineator));
    var text PartEight = Trim(Part($Field,8,$Delineator));

    //If I remember correctly, I only used this next section so I could set the color and style of each bullet. If you want them all the same/default color and text, I think this can be ignored

    var text one="<span style='color:#000000'>" & $PartOne & "</span>";
    var text two="<span style='color:#000000'>" & $PartTwo & "</span>";
    var text three="<span style='color:#000000'>" & $PartThree & "</span>";
    var text four="<span style='color:#000000'>" & $PartFour & "</span>";
    var text five="<span style='color:#000000'>" & $PartFive & "</span>";
    var text six="<span style='color:#000000'>" & $PartSix & "</span>";
    var text seven="<span style='color:#000000'>" & $PartSeven & "</span>";
    var text eight="<span style='color:#000000'>" & $PartEight & "</span>";

    //If you ignore above, then change $one, $two, etc below to $PartOne, $PartTwo...

    "<ul>" &
    If( $PartOne<>"", "<li>" & $one & "</li>") &
    If( $PartTwo<>"", "<li>" & $Two & "</li>") &
    If( $PartThree<>"", "<li>" & $Three & "</li>") &
    If( $PartFour<>"", "<li>" & $Four & "</li>") &
    If( $PartFive<>"", "<li>" & $Five & "</li>") &
    If( $PartSix<>"", "<li>" & $Six & "</li>") &
    If( $PartSeven<>"", "<li>" & $Seven & "</li>") &
    If( $PartEight<>"", "<li>" & $Eight & "</li>") &
    "</ul>"

    ------------------------------
    Michael Tamoush
    ------------------------------
    • GeorgeKhairalla's avatar
      GeorgeKhairalla
      Qrew Cadet
      Thanks for this Michael!
      I wonder if there is a more straight forward way of doing it, hopefully someone will chime in.
      Meanwhile, I'm going to give this method a try, I'm pretty sure it will work!

      Thanks for sharing your cheat sheet! :)

      ------------------------------
      George Khairallah
      CTO
      gotomyerp, LLC
      ------------------------------
      • MichaelTamoush's avatar
        MichaelTamoush
        Qrew Captain
        By the way, this is the rich text for a bullet in its most basic form.

        "<span style='font-size:12px;'><li>First Bullet Text</li><li>Second Bullet Text</li></span>"


        ------------------------------
        Michael Tamoush
        ------------------------------