Consider a scenario where we have two entities: Books and Chapters, with a one-to-many relationship (i.e., each book can have multiple chapters). I currently have a read-only grid that displays records based on the Book entity. One of the columns in this grid is called "Chapters", which displays all associated chapters in a bulleted list.
Since a book can have more than 10 chapters, I'm currently fetching all chapters into a local variable and indexing them based on the Book ID to display in the corresponding grid row.
This approach works fine for now. However, I'm concerned about performance if the chapter count increases more than 5000
Does anyone have suggestions on how to handle this scenario more efficiently?
Discussion posts and replies are publicly visible
HI. If your record "book" has a one-to-many relationship with "chapters", you can try this to display it in a grid.
Hi osanchea . Thanks for suggestion. But as i mentioned, books can have more than 10 chapters and this method limit related record to 10 items.
Hi Barbosa ,You can do it as osanchea to display in grid for a limited items.It's not a best practice to show huge numbers of items in a single grid column, yes you can have n number of chapters per book, ultimately you cannot show it in a record list as a single column, instead you can show it in a new record view, eradicating difficulty of viewing such huge records. You will have a space constraint blocking you to display multiple records: https://docs.appian.com/suite/help/25.1/sail/ux-grids.html#introduction (Check Don'ts).Always check your grid view is intuitive and readable....Hope this helps you!!!
Hi Varun Teja Gurrapu .yeah i agree. I thought of showing only 2 chapters a time with expand icon. So that user can see all chapters on clicking icon if needed. If i follow the above suggestion, user cannot see more than 10 chapters.
Try a tree view style component instead and see how that works, I have used this before for similar use cases ...
Tree View Component
You can also nest the data using Rich text as well.
I think the purpose is the more important question. As a user of this application why would I navigate to this list? What do I want to achieve?
Hi Stefan Helzle . This is just a similar scenario I mentioned earlier. In my actual use case, the user will add multiple child records (possibly more than 10) while creating a new case. On the dashboard, we display a case grid, and the requirement is to show one of the related child records in a column of the case grid, along with an icon beside it to expand and view the full list of related records.
So, it is about these child record, right? Did you consider to load them on demand? You could add a local variable to the individual cell, and load the data for this cell only when the user clicks the icon.
Yeah. That works. I think i would do query in cell level if count of child record data is 10 so that i dont need to query for all cells which is having less child records. Thanks Stefan Helzle