Is this a UNIQUE ID Situation?

Hi all,

I have what I assume is a very basic question, so pardon my ignorance.

I finally set up a system where I haveโ€ฆ

  1. a โ€œmaster databaseโ€ table of items where the current status of an item changes based on user input
  2. another table (I guess it would be a โ€œchildโ€ table) where the user input is creating new rows.

Iโ€™m sure my method is not the best, but I used automation to populate the second table. So my first question is: is that what everyone else is doing? Is that the best way to get a table of โ€œnew actionsโ€ while maintaining a โ€œmasterโ€ database of all my items?

My second question is: when I use this system now, any user input on one of the new rows not causes AppSheet to find that item in my second table and change its status instead of adding another new row, which is what I wantedโ€ฆHow do I make this happen? Is this where โ€œunique IDโ€ comes in?

Again, pardon my naivete. Iโ€™m slowly learning a lot here and putting it to use.

Thanks.

0 8 229
  • UX
8 REPLIES 8

Hello @Ryan_Wagner, it sure seems to be a unique id situation, could you share a screenshot of your second table structure? if you have a repeating key value youโ€™re gonna update your rows instead of making new ones, thatโ€™s why itโ€™s always important to make sure your key column is unique in all cases.


(Table 1 - My โ€œmaster database.โ€)

(Table 2 - The new rows added. This is the table that, if someone interacts with that item again, will not add a new row like I want, but will instead find that item in this table and change itโ€™s statusโ€ฆ)

Hopefully that makes senseโ€ฆ

I see, when you attempt to add a new row to the table 2 do you load the โ€œOBJECTIDโ€ with the same โ€œOBJECTIDโ€ as the table 1? If thatโ€™s the case then thatโ€™s whatโ€™s causing that behavior.

For solving that, i suggest that you add a column that is strictly for storing unique keys for each row for table 2, and using uniqueid() in order to populate it for each new row.

You donโ€™t โ€œneedโ€ to do this for table 1, since it is your master table you wonโ€™t really have repeating entries, since each object should only appear once, this however becomes a problem for your table 2.

Thanks for the help!

I just made a โ€œunique IDโ€ column for the second table. I also just realized that, in that same second table, the OBJECTID (which is essentially just a name for the item), also has an โ€œinitial valueโ€ with the โ€œUNIQUEID()โ€ formulaโ€ฆIs that necessary with my new column? And should I change the โ€œkeyโ€ from the OBJECTID to the new Unique ID column?

Thanks again.

Ah, nevermind! Got it!

I made the unique ID a key and it is now working!

Thanks again.

@Rafael_ANEIC-PY One more follow-up question, while Iโ€™ve got you hereโ€ฆ

Can I also create a unique ID automatically for the first table when someone adds a new item in the first table?

The first table, like I said, is my main database. When someone finds a new item working out in the field, Iโ€™d like them to be able to add it without having to keep trying to figure out an unused numberโ€ฆ

You can always find me here in the forums bro, donโ€™t worry.

Yes, absolutely, itโ€™s always better to have a uniqueid rather than a secuential number for a key, so i recommend it completely.

Awesome, thanks.

Top Labels in this Space