Add Rows to related list using a dashboard view

I hope someone can help me, I've been stuck on this problem for a few days!

Simplifying (we are in the context of a management system for restaurants):
- I have the "Products" table and the "Orders" table.
- Since the relationship between the two tables is "many to many", I created a third "JOIN" table, with inside it the references to the keys of the two previous tables, and, in addition, the "Quantity" field.

prob0.jpg- By doing so, when I create a new instance in the "Orders" table, I automatically find, in the "Ordini_Detail" view, the Related List of the "JOIN" table, with the famous "Add" button that allows me to add Products to that specific Order, through a dedicated form. And so far so good.

 

The question is:
- I think having to add Products to an Order using the dedicated form that Appsheet automatically makes available is rather inconvenient, in the context of a restaurant.
- I would therefore like to be able to add elements to the "JOIN" table without going through the "Add" button, but through a dedicated view of the "Products" table, where, for example, by clicking on a "+" button associated with each Product, it is added to the Order we are handling.
- To do this, created a "Product Selection" dashboard view, which contains the "Orders_Detail" view and immediately below the "Products" view.

prob05.jpg
- I created a "GoTo Product Selection" Action, which applies to the "Orders" tab, of the type "App: go to another view in this app", specifying as target "=LINKTOROW([Order_ID], "Product Selection")" In this way, clicking on any order opens the dashboard view "Product Selection", with the first view "Orders_Detail" already filtered on [Order_ID].
- I then created an "Add Product to Order" Action marked by the "+" button, visible on each product of the "Products" view, which is the second view of my dashboard. This action is of the type "Data: add a new row to another table using values from this row", the "table to add to" is obviously "JOIN". This action should add the selected product to the JOIN table relating to the order preselected in the first view.

The problem is:
The "add Product to Order" action requires the columns of the "JOIN" table to be populated. I don't know how to retrieve the Order_ID of the first dashboard view that I need to populate the "Order_ID" column of the "JOIN" table.
The two views appear to be unrelated.
Instinctively I would like to populate the column with "Orders[Order_ID]", but I get the error:

prob1.jpg

In summary, by pressing the "+" key of a Product in the "Products" view (second of the dashboard), I would like to add that specific product to the "JOIN" table, relative to the specific Order_ID specified in the "Order_Detail" view (first of the dashboard).


I hope I explained myself well, otherwise I'm ready to give clarifications!

Thanks!!

 

0 7 1,367
7 REPLIES 7
Top Labels in this Space