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