Is there a way to force a CUSTOM Virtual Column List to show as an Inline View?

I feel I should know this but just not coming up with a solution.

I want to simulate the REF_ROWS() function but need to select rows by more complex criteria than matching columns between the two tables.

Here is my use case:

I have Products, Options and Customer Discount tables. My goal is to show a Product Pricing view and show all of the information that can affect the final price of that product - Base product price, Option Prices and all relevant Discounts. However, while some Customer Discounts are by an individual product, others are a Discount that applies across the board to all products.

So, I want to create a Virtual Column that pulls ALL discount records together and not just match by the Product I am currently viewing.

I can create this VC with no problem but now I want to display it as an Inline Table and not just a list of ID’s. Is there a way I can do that?

Any List of Ref will be displayed as an inline view.

1 Like

Instead of creating your VC in the parent table as a LIST of child records, try adding a VC of type Ref to the child table and let AppSheet create the REF_ROWS() for you in the parent table.

For this to work, you may need to add a column to the parent table to store a ‘query’ so that the child records’ VC will find and match to that parent row.

1 Like

Thanks @Steve! Just needed to update the List Element Type to Ref. If I had only looked more closely at a REF_ROWS() column!!

A follow-up question. For a REF_ROWS() displayed Inline Table when clicking the “Add” button under the table it somehow knows to pre-populate the “Parent” (though not a formal parent/child relationship) table record ID into the associated Form.

This same behavior does not happen for Inline table displayed for my custom Virtual Column. I know I can use a LINKTOFORM() action and attach to Row Selected behavior. But, is there some easier way to make that happen you are aware of? I mean, it happens automatically for the REF_ROWS() VC’s.

Thanks for the reply. Changing the Element Type to Ref in the VC was what i was missing.

REF_ROWS() must be used to get the column auto-populated using the Add button of an inline view. :frowning:

1 Like