Duplicate Key allowed when filtered?

Will appsheet allow a duplicate key if the data set is filtered down with a security filter?
i.e. say there is a key XXXX in some of the data that has been filtered out with a security filter. Can a user add a record with XXXX as a key?

0 8 736
8 REPLIES 8

@Grant_Stead
Though itโ€™s sliced/filtered, I believe duplicate key is contradictory to the nature of a RDBM

What is RDBM?

I think he meant Relational DataBase Management system

Relational DataBase Model/Management @Grant_Stead

Interesting question! If we use security filter to reduce the data sent to the app, then there is no way to protect from key duplication? That would be a problem. How to ensure Referential Integrity.

If a security filter is used, then the app running on the device has no way to know if a new key value being added isnโ€™t unique. So it is going to succeed.

However, when the change is synced, our service is going to first look to see if that row (some row with the same key) already exists. If it does, an Add row operation is converted into an Update and it will update the row that already exists with the same key.

Note that the reason for this behavior is because even with just a single user, the same Add operation may get synced multiple times (due to networking failures). It is possible that the change was applied but the app running on the device doesnโ€™t know it succeeded because the network failed. So when it tries again some time later, we have to find that same row and try to modify it.

Roger that. Thank you for the explanation of the behavior.

@praveen - good to know you try and handle that in the background to prevent key issues. Very nice to know! Once again, Appsheet is handling a lot of the complexity in the background

Top Labels in this Space