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.

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.

1 Like


(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…

1 Like

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.

2 Likes

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.

1 Like

Ah, nevermind! Got it!

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

Thanks again.

2 Likes

@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.

3 Likes

Awesome, thanks.

2 Likes