MySQL table Ref won't work!

Dana_S
New Member

Hello,

I imported 2 tables form MySQL: Orders & OrderDetails
Order table contains generic order information while OrderDetails contains order items, now I want to be able to see item list per order (as ref table) each time I tap on an order but seems my configuration wonโ€™t work.

I configured as follow: in table OrderDetails, I changed Type for OrderNo to Ref then selected Orders table hoping this will take care of the task I want as mentioned by an article about referencing in AppSheet.
This creates the reverse record in Orders table but nothing shows on the Orders view, what am I missing?

And is this the only way to achieve what I need? Is there a place where I can add an if statement, like if OrderID(table2)=OrderId(table1) then show?

Best,

0 12 414
12 REPLIES 12

EIG
New Member

I think you just have it backwards. The Ref should be on the Orders table.

First, Iโ€™m having a fascinating issue with REF today. Second, you do have your ref setup correctly. Third, you need to look at your UX viewsโ€ฆ Make sure you have the associated inline views. Forth, do you have slices?

How โ€œassociate inline viewsโ€?
No slices so far.

in the Order table is OrderNo tagged as the Key column?

No itโ€™s not, and seems I canโ€™t change it, I expect because OrderNo contains some chars (ORD#####), anyway, does it need to be a Key? What if I needed to have more than one Ref with that table? I assume I only can assign one Key per table.

The key field must be unique.
Other than that when you set the orderno column to key, make sure you uncheck whatever else is identified as keyโ€ฆ THEN save and verify

Steve
Platinum 4
Platinum 4

Thanks Steve for those, I already read most of that except for Key one.
Can you tell what the issue might be in my case? Is it possible itโ€™s related to some other stuff like itโ€™s a new account/free account/Read onlyโ€ฆetc?

I doubt it. I suspect your data just isnโ€™t properly structured. In order to do what youโ€™re trying to do, you need to understand keys and references.

Dana_S
New Member

Thanks for your help everyone, I was able to fix it.
First order_no was not Key then I had to change itโ€™s type from LongText to Text to be able to make it Key, seems LongText cannot be Key.

Cheers,

Top Labels in this Space