Hello all!
I'm currently working on an interactive dashboard in Retool and need some guidance on implementing a specific feature. I've attached a picture to illustrate my concept better.
Background: I have a main table sourced from Snowflake, displayed through a Retool query. This table contains thousands of records, each representing a person with fields like PERSON_ID
, AGE
, CITY
, ZIP
, and boolean flags such as IS_TALL
, IS_FUNNY
, IS_A_PROGRAMMER
. The table supports server-side pagination, and there's a secondary query for the record count to manage this.
Requirement: My goal is to create a dynamic interface with three (eventually more) cards, each representing one of the boolean attributes (IS_TALL
, IS_FUNNY
, IS_A_PROGRAMMER
). Each card should display the count of people in the entire dataset for whom the respective attribute is TRUE
.
Additionally, I want these cards to act as toggle filters. For instance, if a user clicks on the IS_FUNNY
card, the table should update to show only the records where IS_FUNNY
is TRUE
. Simultaneously, the counts on the IS_TALL
and IS_A_PROGRAMMER
cards should adjust to reflect the number of people who are both funny and tall, and funny and programmers, respectively.
Challenges:
- How to set up these cards to dynamically display counts based on the entire dataset and update as filters are applied.
- Ensuring that the table updates correctly when these filters are toggled.
- Adjusting the counts on the other cards based on the applied filters.
I'm not sure what the best approach would be to implement this in Retool. Should I use JavaScript queries or is there a more straightforward way through Retool's native components and query configurations? Any insights, examples, or guidance on how to achieve this functionality would be greatly appreciated.
Thank you in advance for your help!
Mock-up examples:
Step 1:
Step 2:
Step 3: