Dec 28 2020 07:29 PM
I am new to JSON formatting a column. In a SharePoint online list I have a lookup column that permits multiple values from the Document ID column from a document library. Three other columns are also brought in, one of which is date.
Without applying any JSON formatting, the lookup column itself listing the multiple Document IDs displays just fine with separate lines. However, each of the multiple values in he other three other columns that are brought in with the lookup column do no display on a new line. Rather, they displayed with a semi-colon between them. This is less than ideal. I would like to format each of the multiple values to display on a new line. I have attempted to use various JSON examples without any luck.
Can someone please help with an example for JSON formatting the lookup column and the three other columns brought in with it?
Thank you
Jan 02 2021 09:17 AM
Bump, any idea? @NanaBar
Jan 02 2021 02:09 PM
@NanaBar , look at this example:
Complex HTML elements formatting
You will need to define column formatting for each of your 3 multiple values columns. Basically you need to use the foreach attribute that can define, for example, a div for each value (using the children attribute).
Hope this help.
Mar 06 2021 03:06 AM
I'm trying this same thing. I'm concerned the "forEach" function doesn't work on additional columns that are imported along with a Lookup column.
Interested to hear if anyone has a solution.
Mar 06 2021 03:20 AM - edited Mar 06 2021 03:30 AM
Okay, so it looks like the additional columns that pull from the other list treat their contents as a single string with semicolons distributed throughout. It does not treat them as an array.
So how do you take a string with semicolons and turn it into an iterable array?
That's not a feature yet. Go upvote this feature recommendation if you want it to be added.