View with Ref table not respecting selected data slice

Very confused with this one and wondering if it's something anyone else has encountered...

In my app I am creating a stacked bar chart that looks typically like this;

Josh_B_0-1709566246739.png

This is quite crudely built... I have a 'Chart' table where each user of the tool has multiple rows, then virtual columns that calculate the 5 different series, from my main 'Tool Inputs' table. A security filter means users only ever see their own rows in the table so the app basically sees the 'Chart' table as 11 rows and 5 columns of data that is plotted as above.

Josh_B_3-1709566683941.png

The main 'Tool Inputs' table is sliced based on filters set by the user (captured in a different table with one row per user). Everything points to this slice.

I have a ref set up in the 'Chart' table to provide relevant rows for each column on the chart. 

Josh_B_2-1709566643409.png

This seems to work perfectly - if I preview the data, it returns the row_IDs exactly as I would expect - only showing rows that are present in the current sliced data.

Josh_B_6-1709567022618.png

But I start to see issues as soon as I'm trying to display these referenced items in the app itself. For example, here, with the filters I have applied, there should be 3 items in 2025 Q4 with a three quarter status. You can see in the snippet of the table view next to it that this is correct, and this respects the various filters that have been applied.

Josh_B_5-1709566966909.png

If I click on the 2025 Q4 column on the chart, it takes me to a view that correctly shows 2025 Q4 items, but no longer seems to reference the slice - the green shield item was previously filtered out.

Josh_B_7-1709567162609.png

When I check exactly which view the app is going to, it is correctly referencing the 'Chart' table;

Josh_B_8-1709567438731.png

But if I hover over the Ref table and select Edit View;

Josh_B_9-1709567521000.png

It reveals that it is pointing to the table view for the overall 'Data' table - not the slice;

Josh_B_10-1709567578593.png

I've encountered the situation before where I have needed to manually create a detail/table view for a slice that Appsheet will then automatically recognise, by I've only just started playing around with Refs, and I'm not sure how to fix this.

How can I make sure that my Ref table embedded in my detail view points to the slice, and not the overall dataset?

 Thanks!

Solved Solved
1 3 111
2 ACCEPTED SOLUTIONS

Not sure if I'm following your setup completely, but first make sure that your Ref_list column is set with a base type of Ref, and pointing to the Slice instead of the base table. This is a separate setting on the column besides the table/slice name that's set in the REF_ROWS expression.

View solution in original post

Sorted it! You put me on the right track!

I needed to first change the [Ref_Quarter] column to be a Ref type, referencing the Charts table. Then I had to change the [Ref_List] column to still be a list, but have a list item type of Ref. 

View solution in original post

3 REPLIES 3

Not sure if I'm following your setup completely, but first make sure that your Ref_list column is set with a base type of Ref, and pointing to the Slice instead of the base table. This is a separate setting on the column besides the table/slice name that's set in the REF_ROWS expression.

Thanks, Marc. I think you're probably right, as I currently have the Ref_list column set as a 'List' type. Changing it to a Ref and setting the source table to the appropriate slice returns a column type mismatch error though...

Josh_B_0-1709627485560.png

edit: in case I'm getting this wrong from both directions, here's the Ref_Quarter field;

Josh_B_1-1709628119262.png

My thinking (which may be wrong) was that;
- ToolInputs table contains the main dataset
- ToolInputs[Ref_Quarter] calculates a single value for all items in the main dataset that defines the quarter the item is against
- Charts table contains one row per quarter
- Charts[Ref_List] uses a REF_ROWS expression to return a list of row IDs for all items with that quarter
- Use the [Ref_List] column to provide detail on relevant items when clicking through on the chart view

 

 

Sorted it! You put me on the right track!

I needed to first change the [Ref_Quarter] column to be a Ref type, referencing the Charts table. Then I had to change the [Ref_List] column to still be a list, but have a list item type of Ref. 

Top Labels in this Space