Hi All
When your dealing with a list column type, you get to chose a line seperator
does anyone know if its possible to have a line break rather than a seperator so the items appear on seperate lines
for instance
a,b,c would look like
a
b
c
is this possible?
Hi, yes, i think it’s possible to display items from a list column type on separate lines using a line break as a separator in AppSheet. You can achieve this by using the SUBSTITUTE() function to replace the default separator (usually a comma) with a newline character. Here’s how you can do it:
-
Create a Virtual Column: First, create a virtual column that will format your list with line breaks.
-
Use the SUBSTITUTE() Function: Use the following expression to replace the commas with line breaks:
SUBSTITUTE(TEXT([Your_List_Column]), ", ", "
")
Example: Assume you have a list column named [Items] that contains values like "a, b, c". Here’s how to set up the virtual column:
``
Go to **Data > Columns and select the table containing your list column.
Add a new virtual column and name it something like [Formatted_Items].
Set the app formula for [Formatted_Items] to:
SUBSTITUTE(TEXT([Items]), ", ", "
")
ÂżHow it Works?
- The
TEXT() function ensures the list is treated as a text string.
- The
SUBSTITUTE() function replaces each comma and space (, ) with a newline character (\n).
Displaying in a View
To ensure the formatted list displays correctly in a view:
- Go to UX > Views and select the view where you want to display the list.
- Add the [Formatted_Items] column to the view.
This will ensure that each item in the list appears on a separate line when displayed.
Notes
- Ensure that the list items do not contain commas if they are not intended to be treated as separate items.
- You might need to adjust the display settings or the layout of your view to handle multiline text properly.
Using this method, your list “a, b, c” will appear as:
a
b
c
This approach helps in creating a cleaner and more readable display of list items in your AppSheet app.
3 Likes