How to show only a single icon or boolean on an array column in table view
A record may have multiple files uploaded that are stored in DB column
attachments
as an array. In the table list I want to show a single icon if the record has any attachments at all. However, the code below shows a list of icons for each of the item of the array in the attachments
column.
3 Replies
Hey Dima, yeah I had weird issues like that too. It's possible to use workarounds :
Notice I intentionally used different column like 'created_at' otherwise if you use 'attachments' it will still render an icon for each count
Nice, thank you so much
You could also use
or even better, just load the
attachments_count
instead of loading all the attachments just to check whether they exist.