Simple Solutions: Display Choices in Bullet or Numbered List
Jul 18, 2022
Multi-select fields are a vital part of many Quickbase workflows!
Being able to select several items from a list is super handy.
However, they don't always look that great when printed, emailed, or even viewed on the record.
That's where HTML can come to the rescue!
HTML can seem a bit daunting, but we only need a little bit to magically transform our Multi-select list into an easy-to-read bullet list.
This method can be used on list-style fields such as:
- Multi-select Text
- List - User
- Formula - Multi-select Text
- Formula - List - User
- Combined Text Summary
Note: User lists will display the user ID (or email if no id has been specified) associated with the user, not the user name.
Start Here:
- Add a new Formula - Rich Text field to the same table that has your list field.
- Choose the style you want to use below (Bullets, Numbers, or Image).
- Read through the text to understand how the formula works.
- Copy the formula into your formula field.
- Update the [Multi-select Field] references to your Multi-select (User List or Combined Text Summary) field.
For a Bullet list:
For a bullet list, we define the start to our list with an HTML tag called "unordered list" which is represented by "<ul>".
The beginning of each item in the list is tagged as a "list item" which is represented by "<li>".
Then, to indicate the end of an item, the "</li>" closing tag is used. (Notice the forward-slash to indicate 'closing' or end)
After all list items are listed, the end of the whole list is indicated with the closing unordered list tag "</ul>".
You can see all of these tags represented in the formula below.
To convert the Multi-select list field into the proper format, we use the SearchAndReplace function to replace the semicolon that separates the list items with the HTML list item tags.
This little trick works like magic!
In addition, I've started the formula with an If function to first check if there is any value in the multi-select field. If there is no value, no need to create bullets, otherwise, the bullets are created.
Example:
Rich Text Formula:
If(ToText([Multi-select Field])="","",
"<ul>" &
"<li>" &
SearchAndReplace(ToText([Multi-select Field]),";","</li><li>") &
"</li>" &
"</ul>")
For a Numbered list:
For a numbered list, we define the start to our list with an HTML tag called "ordered list" which is represented by "<ol>".
The beginning of each item in the list is tagged as a "list item" which is represented by "<li>".
Then, to indicate the end of an item, the "</li>" closing tag is used. (Notice the forward-slash to indicate 'closing' or end)
After all list items are listed, the end of the whole list is indicated with the closing ordered list tag "</ol>".
You can see all of these tags represented in the formula below.
To convert the Multi-select list field into the proper format, we use the SearchAndReplace function to replace the semicolon that separates the list items with the HTML list item tags.
This little trick works like magic!
In addition, I've started the formula with an If function to first check if there is any value in the multi-select field. If there is no value, no need to create a numbered list, otherwise, the list is created.
Note: The numbered list will be ordered in the same order as the multi-select field.
Example:
Rich Text Formula:
If(ToText([Multi-select Field])="","",
"<ol>" &
"<li>" &
SearchAndReplace(ToText([Multi-select Field]),";","</li><li>") &
"</li>" &
"</ol>")
BONUS for a Bullet List with Custom Image:
If you want to get FANCY with your bullets, it's also possible to use images.
I recommend using an image from the Quickbase Icon Library in the 16x16 size. This library is maintained by Quickbase and all images can be viewed by anyone.
To use your own image, it will need to be available on the web to your users. For example, if you upload the image to a Quickbase record, you can use the image's URL in the formula. However, only users with permission to view that field will be able to see the image (unless you also check the box in the file attachment field to "Allow access to this file attachment from a Quickbase link without signing in").
To create the image-based bullet-style list, we use the unordered list "ul" and list item "li" tags (see For a Bullet List above for details on these tags), but combine them with additional styling to set a "background" image and position it alongside the text.
This is done through the use of a formula variable to keep the formula easy to read and troubleshoot.
The URL in the formula below can be swapped out for your image's URL and the numbers colored in red can be adjusted to change the size of the image and its position relative to the text.
Example:
Rich Text Formula:
var text IMG =
"style='" &
"background: url(https://images.quickbase.com/si/16/007-star.png) no-repeat left top;" &
"background-size:16px;" &
"height: 20px;" &
"padding-top: 2px;" &
"padding-left: 22px;";
If(ToText([Multi-select Field])="","",
"<ul style='padding: 0; margin: 0; list-style-type: none;'>" &
"<li " & $IMG & "'>" &
SearchAndReplace(ToText([Multi-select Field]),";","</li><li " & $IMG & "'>") &
"</li>" &
"</ul>")
Recommended Usage
Now that you have a bullet (number or image) list, here are some recommendations on how/where to use it!
- Use the Rich Text Formula field on Email Notifications.
- Use the Rich Text Formula field on table Reports (the exception is when they may be exported as the HTML does not look good when exported to .csv files).
- Add both the Multi-select and Rich Text Formula fields to your form. Then adjust when they are displayed in the form element settings (shown below). This will ensure users can still make selections when adding or editing, but when viewing or printing the bulleted list is displayed.
- For the Multi-select field, set it to display when the form is used for "edit or add"
- For the Rich Text Formula field, set it to display when the form is used for "view"
- For the Multi-select field, set it to display when the form is used for "edit or add"
Learn More About HTML in Quickbase
Blog Post: 7 Ways to Use HTML in Quickbase
Download: HTML/CSS Cheat Sheet for Forms
Training: HTML Formula Crash Course
Tool: Super Fast HTML Formula Converter Tool
Feeling like a Junkie? Subscribe Now!