Multiple Standard List Views for a Single Table Component

  • 1
  • Question
  • Updated 2 years ago
  • Answered
I was wondering if there was a way to have multiple views for a single table component, these different fields would just shows different fields from the model.

I am thinking something similar to the list views currently in Salesforce.

To help illustrate what I am thinking:

Model for Object A has fields [Name], [Field1], [Field2], [Field3], [Field4], [Field5], [Field6]

List View 1
[Name1], [Field1], [Field2], [Field3]
[Name2], [Field1], [Field2], [Field3]
[Name3], [Field1], [Field2], [Field3]
[Name4], [Field1], [Field2], [Field3]

List View 2
[Name1], [Field4], [Field5], [Field6]
[Name2], [Field4], [Field5], [Field6]
[Name3], [Field4], [Field5], [Field6]
[Name4], [Field4], [Field5], [Field6]

I thought this would be possible by just adding a second Standard List View, but it does not seem to be working from me, and I am not seeing much in the tutorials that does not require JavaScript.

Any help is greatly appreciated. Thanks!
Photo of Sean

Sean

  • 630 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Sean,

I think your best bet is to create two different tables on the same model, and conditionly render them based on a ui-only picklist field (where you store the names of your views) that you put above the table.
Photo of Sean

Sean

  • 630 Points 500 badge 2x thumb
Thanks Matt, that will work. I really appreciate the quick reply.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
You could add a tab set and put a table in each tab of the tab set then set it to display the tabs as a list.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Yes! I like Raymond's idea even better. Makes it cleaner on the builder side.