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.

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.

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



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

11 Likes

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?

WillowMobileSystems:

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 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.

[In a Table View, setting a 'Group by' column removes column from the "grid". Explicity setting it into Column Order should override that](https://community.appsheet.com/t/in-a-table-view-setting-a-group-by-column-removes-column-from-the-grid-explicity-setting-it-into-column-order-should-override-that/37415) Feature Requests

[image] As seen in the screenshot, I’ve set the [text] column as the ‘Group by’ column. Default behavior in this case is that this column does not get displayed in the table grid, but instead shows as a header for a set of rows. My request is that under the above circumstance, if you also explicitly add that column into the ‘Column order’ section, then the column should again, and redundantly, appear in the table grid.

1 Like

Marc_Dillon:

This reminds me of how drill-down Group By s 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.

Yup.

1 Like

Marc_Dillon:

I’d also say this is a completely separate issue and should be posted in a separate thread.

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

[New Bug Encountered: Columns being removed when viewing Inline Tables in Full Screen mode](https://community.appsheet.com/t/new-bug-encountered-columns-being-removed-when-viewing-inline-tables-in-full-screen-mode/35065) Questions

When viewing some app object in Detail view that has Related items list, I click on on the “View” button to see the Inline Table in Full Screen. I find that the column for the main object I was viewing has been removed…regardless if the column was explicitly added to the view column order or not. So if I am viewing a Product that has a list of Product Options and click “View” on the Inline Table, the Product column is not shown in the full screen view. But if I am viewing an Option that also…

2 Likes