AppSheet linked tables entries displaying same values when expanded

I have created linked tables in Appsheet with the "ref" primary field. When a user scans the order ID, the items sold under that order ID are displayed. However, I have created a barcode scanning field in expanded view so that the user can see which items are sold under that order ID and scan it. Post scanning I have created a "Status" field with a formula that would show the user "โœ…" if the item he has scanned matched with the item in the list. 

But, for instance, If order ID - 1111 has 3 items, and when the user clicks on any of the three items the view displays only the first entry even if clicks on the second row. Refer to the attached screenshots to get an idea about the error.  

Table - AppSheet_Order_ID and AppSheet_Order_Details are linked with the key field (ref)

Screenshot 2022-08-26 at 12.25.27 PM.pngScreenshot 2022-08-26 at 12.26.08 PM.pngScreenshot 2022-08-26 at 12.26.17 PM.pngScreenshot 2022-08-26 at 12.26.31 PM.pngScreenshot 2022-08-26 at 12.45.56 PM.pngScreenshot 2022-08-26 at 12.46.17 PM.png


0 5 118
5 REPLIES 5

In the AppSheet_Order_Details table in AppSheet, which column is set as the Key?

In the view where you are showing the AppSheet_Order_Details column, the row list is displayed in an Inline View.  That view is probably named "AppSheet_Order_Details_Inline" unless you have changed the names.  That Inline View is set as a table and it has a Row Selected property where you can attach a custom action if you wish.  Have you - attached a custom action to the Row Selected behavior of this Inline view?  See image

Screen Shot 2022-08-26 at 9.29.21 AM.png

In AppSheet_Order_Details Table, Order_Id is set to the key column. 
And I have not added an inline view for any table. All the views are set to the "Form" view.
Once I scan/enter the order ID in the Order_Id table, the table/rows containing that specific order Id automatically pop up and once I click on any of the rows, like I said it opens only details of same order item despite clicking on any of the items/rows. 
Also, I have not added any custom event action. It is set to Auto. 
Screenshot 2022-08-26 at 7.43.52 PM.png


Key columns MUST be a unique value for each row. Since you have several rows with the same Order_ID, Order_ID cannot be the key column.  Instead, set "Identifier" as the key column and your row selections should work just fine after that

@WillowMobileSys But, setting identifier as the key column wouldn't display the multiple order items in that order ID. Let me explain what I'm trying to accomplish. For instance, order ID 1111 has three items that are Item A, Item B, and Item C. Now entering Order ID 1111 in the Order_ID view will display the inline items of that order that is Item A, B, and C. Now, if I change the key column to identifier this wouldn't be possible.

I do understand that the key column has to be unique but we're talking about the data that is already populated in the google sheet.

The main idea behind the app is to make sure the warehouse executive is packing the right item by scanning the barcode. For instance, he has to pack order no. 1234 under which items a, b, and c are being sold. Now, once he enters the order ID i.e 1234, he'll see the list of items that he has to pack i.e a,b and c.  These items will be displayed in the inline view as both the sheets (Order_Id and Order_ID_Details) are linked. Now,  once he clicks on the item "a" in the inline view the order details will open in the form view where I have added two fields a  Barcode Scanning field and a status field that matches the barcode scanned by the user and barcode order details and return "โœ…" if the user has scanned the correct product.  

I have another way of doing this but I don't know how to accomplish that. I have also posted the question regarding that alternative way of achieving this but no one has answered it yet. You can check that out as well and let me know if you can suggest a workaround for that,

https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/Create-Prefilled-fields-with-Checkbox-and-Barco... 



@dhaval wrote:

@WillowMobileSys But, setting identifier as the key column wouldn't display the multiple order items in that order ID.

Correcting the Child key should not break the relationship unless you have done something odd in setting it up (and it doesn't appear to me you have but I haven't seen all of your app data/tables).  For the relationship to work you only need the Parent row key as a column in the Child table.  The Parent Key column is simply a Ref to the Parent table.  It should not and CANNOT also be the key of the Child table.

Above everything else you must properly establish the Keys and relationships between the two tables.  You MUST MUST MUST, reset the Child table Key column to one that has a unique value for each row.  From what I have seen, "Identifier" is that column.  Correcting the key should not break your views.

The reason why row selection of the Child rows does not work is that you have 3 rows with the same key value.  When you tap a row to view it, only the row key is passed to the view.  The view only expect a single row.  When there is more than one, AppSheet is simply picks the first one.  That is why you see the same row no matter which child you select.

Once you have establish the correct Keys and verify relationships still display correctly in the views, then we can focus on anything else that may not be working for you.

 

Top Labels in this Space