REF_ROWS virtual column not using correct inline view

I’ve encountered an issue that I cannot resolve.

I created a slice, and the slice works as expected. However, when I update the system-generated “Related” virtual column to use that slice instead of the original table, the expression comes back valid, the test data looks correct (testing the Slice and testing the REF_ROWS expression), but the Inline View still displays the values from the table not the slice.

The Test Data for the ClassAttendees Slice, showing the row that should be excluded:

The “Related StudentAttendances” column expressions is REF_ROWS(“ClassAttendees”, “ClassID”). The Test Data for the column:

I did notice that the expression outcome (leftmost column) has the correct IDs from the StudentAttendance table (3 values), where the actual data in the column (rightmost column) has the 4 values from the table, not the slice.

I even manually created a VC to use the slice, and got the same test results pictured immediately above.

The Detail View is clearly still using the system-generated inline view that uses the table. The highlighted row should NOT be displayed according to the slice:

2020-10-03 10_32_48-Student Tracking - AppSheet

EDIT: I noticed that the header shows the correct count - “Attendees (3)”, but the view shows 4 records!

I had asked a related question about inline views here and it was indicated that an Inline View should have been created automatically for the Slice (ClassAttendees_Inline), but no inline view was created for the slice, even when I updated the REF_ROWS expression. I manually created an Inline View for the Slice, and that Inline view omits the row correctly.

Did I miss something in configuring the Related StudentAttendance column? How do I get it to use an inline view that isn’t the system generated one?

These should match:

image

1 Like

That got it! I figured it was something small that I missed…and that likely answers the issues in my other topic as well!

Thanks so much!

1 Like

Actually, let me explain for the curious.

The Referenced table name setting is really what’s critical here. That setting determines what data set’s views are used to display the referenced row’s data, and which data set is used when the referenced rows are dereferenced. The list produced by the App formula expression does not strictly need to reference the same data set, it just has to produce values that match the key column values of rows in that data set. Making sure the two match is just the easiest and surest way to ensure proper operation for most apps. There are legitimate reasons an app creator might use different data sets, though.

3 Likes