Avoid duplicate entry in google sheet

Hi Everyone,
I have upload / post record through app in google sheet. but duplicate entry is made / post. kindly guide how to avoid duplicate entry / record. pic attached.

All the timestamps are different? Show your relevant blocks.

avoid duplicate entry in "B" Column and "H" Column

Use gviz with emp code and date col

After clicking the button to submit, first call the emp code data.. if the response content having only header then No duplicate item is there, so post the text in gsheet , but if it returned more than the header the. Alert it is a duplicate entry.

Spicy_Topics, can you share any tamplate

Pls ref here how to use the gviz in MIT app (credit to @TIMAI2)

any aia template. or video

Have you refer that site ? Didn't work? Make the sheet sharing option minimum as Viewer and try

Is your problem with sending data TO the google sheet, or with reading data FROM the google sheet ?

No no both condition are working fine sending and reading. I Just restrict / avoid duplicate entry in Google sheet during sending through app.

I think it can be achieved, quering the emp code and date before saving the data. If the query shows any result excluding the header then alert user that this is duplicate entry of the day. Else you can opt to save the data in gsheet. Based on this user can save data for the emp per day only one time only

1 Like

This is a sheet design error.

You need an extra sheet of detail entries that gets summed by day in a separate sheet of =SUMIFS() formulas by those two key columns.

If the summary row is already there then you just skip adding it.

Look at my Marathon sample.

I am having trouble guessing the work flow associated with this data collection technique.

Is it possible for an employee to have separate meals at the same location on the same day but at different times?

How many rows would you need for that?

1 Like

I want that when a entry send in google sheet example; (code 100304 & date 15 december)
same entry don't allow to send in google sheet.

Yes, on clicking generate button, call gviz query using the condition Select B = 'emp code' and H = date ' Datetext' . (Pls ref the previous post for generating weburl)...
In web got text block event, convert the response content to list by using list from table text and count the length.

Edit:

On clicking the send button use this logic

If the length is 1  
Then call web url to send data
Else show alert, this is duplicate entry.
1 Like

Gsheet_1.aia (6.8 KB)

Make copy this sheet.. Script code already added, just deploy it and paste the script url and gsheet id alone in blocks part and Test the logic

1 Like

We don't know if you are managing Google Sheets with a Script or with the Spreadsheet component, if you use the latter, you can use the ReadWithExactFilter block.

Otherwise you can refer to @TIMAI2's tutorial and @Spicy_Topics's idea.

In this example you get the "Meal Date" from EmpCode 20000856

[change sheet=hoja1]

borrar_gzip_sheets.aia (2.3 KB)