Hello, I need help, how can I validate that y...

Hello, I need help, how can I validate that you do not enter a data that another user has already entered?

tks

0 15 939
15 REPLIES 15

@Notificaciones_Notif specifically which data or how much data you want to validate? Can you elaborate your query a bit more?

I need to validate before a row is inserted that is no longer in google sheet. It is a very basic validation when working with concurrent users. The problem is that AppSheet only looks for the data on the device and not on google sheet.

It is the problem that I have for some time and the solution you give me does not work. You should have the option that before inserting a record validate on the table that this does not exist, not on the device locally, this does not make sense. It really is a very necessary and basic validation when working with concurrent users.

Iโ€™ve been working with you for almost 2 years and this has not been solved, and Iโ€™m sure Iโ€™m not the only one who has the same problem.

If the data is not in the device you donโ€™t have any chance to cancel the process or notify the user. If the record already exists, it will overwrite it.

Leventโ€™s example will help but overwiting can still happen if two users are using the app at the same.

Exactly.

This is the answer of AppSheet: Sorry this has continued to be a problem. Since the platform allows working offline, the only way to be certain would be to block duplicates at the point of sync rather than the point of save. Ideally making the column to key would be all you need to do in that case, but the current behavior is to treat an โ€œaddโ€ of a key that already exists as an update instead of rejecting it. In many cases it would be better to reject it. We are working on infrastructure changes that will enable more control for the app creator to decide how the platform should handle handle data conflicts and when to reject them. I think once that is done it will provide a better solution.

Yeap, I know

Thanks. For the moment I have to make the app with Java. I hope this funcinality is included quickly, it really is not worth having to create something from scratch for not having such a basic validation.

@Notificaciones_Notif

When having concurrent users, there is no way to validate the data between those users unless the data is recorded to the sheet. You can easily validate your data as per your records in the gSheet but you cannot validate the โ€œlive/streamingโ€ data. To the best of my knowledge, there is no any platform or software that can compare data โ€œon-the-airโ€. You may also experience duplicates data if you enforce offline data content, as the data will be on the userโ€™s device cache rather than the back-end till it pushes the record to the database.

Effectively the validation must be done when the data is already stored in the sheet. But according to the logic of the app, if the data already exists, the information of the last user who entered it is updated, so the last user is the one who wins. I want to be able to validate that if the data is already on the sheet, I will generate an error message to the user who is entering the same data, taking into account that the last user has not synchronized and does not yet know that this data already exists.

Please check this older postโ€ฆ plus.google.com - TIP OF THE WEEK - Validation Many of you have asked how to add a validation โ€ฆ TIP OF THE WEEK - Validation Many of you have asked how to add a validation โ€ฆ plus.google.com

The example you sent only works if the data is on the device, but if it is not there has no effect.

It should be a workflow rule. If the record exists on the sheet, generate an error message and return.

@Notificaciones_Notif you can simply check if the user had not syncโ€™d the app for a defined time limit, i.e. 5mins. and not let the user save the form

How do I do this?

Construct a sheet with 1 column and 2 rows only including the header. Name the header like [LAST SYNC] and name the sheet as you like. Import this sheet to your app. Append NOW() expression to this columnโ€™s AppFormula. In your form, you can now validate the time elapsed like:

=MINUTE(NOW() - ANY(SELECT(Tablename[LAST SYNC], TRUE) - โ€œ00:00:00โ€) <= 5)

Top Labels in this Space