Sample App : Child table with multiple parents. Show different inline views for each parent

Here is a common scenario, where you may have 2 main data tables, then a single “join” table that is a child of both. In the attached sample app, you see the scenario of product and order, with the join table being line_item. In the join table, there is a reference to a product record, as well as an order record, amongst other data such as quantity.

Here is the backend data

3X_4_c_4cf9f4bd568dfce1d6806511705dd9ad9a9c39c4.png

3X_9_8_98a3d60a24247c559b21250649ac2a1fce90b092.png

3X_1_a_1a9a4590bc88e6c1bec9e522a7bec8c1eb66aae3.png

The Detail views for both parent tables will show an inline view of “Related line_items”. However there is no “natural” way to show a different inline view depending on which parent table the user is in. Consider that from product, you’d want to see [order] and [qty] columns, but from order, you’d want to see [product] and [qty] columns.

The way to accomplish this is to start by creating a new slice for line_item table.

Just a basic slice, include all columns, include same permissions, do not include a row filter condition.

Next, in one of the parent tables (I chose product), create a new Virtual Column. You’ll copy the REF_ROWS() expression from the existing “Related…” VC, and simply change the table name to the name of the new slice.
REF_ROWS("new slice name" , "ref-column" )
3X_7_7_771b1ad2ffa028ee9a918d36d7502abb5d5b0cd1.png

Hide the original "Related..." VC, and show the new one.

Create your own inline view for this new slice, however you'd like.


Now you will see different inline views, based on which parent record you are viewing from



You can find the sample app “Differing Inline Views” on my portfolio, here:
https://www.appsheet.com/portfolio/546920

13 4 1,529
4 REPLIES 4

I ran into this recently in an app. Not sure how I resolved so I’ll have to re-review and apply this tip.

What I found particularly annoying is that when you click on the View button on the Inline view to see more rows, the appearance of the key column behaved differently.

For example, if I was in a Product Detail view showing the line_item Inline table, when I click View to go to the full-screen view to see more rows, I want the Product column to show as a reminder of what Product was being looked at (yes it is needed).

In the Detail view’s Inline table, I don’t really need to see the Product because Product is being shown in the Detail view above.

HOWEVER, what I found was the Product column would show in the Detail view Inline table but would be automatically removed from the full-screen view, where it is needed the most. I believe the behavior should be reversed. I think I ended up creating a “display” column to get around the issue.

But maybe this approach will resolve that problem as well?

Hmm, it appears you are correct. I don't believe I've ever seen this before.


3X_6_0_60e1ca3affc4c18dba0d58c42784a749eeae1430.png

          |
          |
          V

3X_a_1_a1e7915cb55f9ec932a30a8495b4be1ed50b0776.png

I tried various show_if expressions to try and force it to show up, none worked (TRUE , CONTEXT("View") = ""…)

This reminds me of how drill-down Group Bys work, once you click one of the groupings you can’t see which group you are in anymore. I’d hazard a guess that the same mechanism is in place here for fullscreen filtered inline tables.

I’d also say this is a completely separate issue and should be posted in a separate thread. I also have a Feature Request that may fix the same issue, if it turns out to be related to groupings.

Yup.

Been there. Done that! Should I have mentioned it?

Top Labels in this Space