Database Update issue (Spreadsheet)

Hi Guys, I need help on solving this issue/bug. once the upload button is pressed i have set all data from tinydb to be uploaded to spreadsheet. but the issue is it is only uploading a few of the data. is there any solutions on this?

Blocks:

Results:



The script I used for the spreadsheet if needed

function doPost(e) {
  return ceksheet(e);
}

function doGet(e) {
  return ceksheet(e); 
}

function ceksheet(e) {
  var ss = SpreadsheetApp.getActive();

  // Get data from the request parameters, using consistent parameter names
  var treeID = e.parameter["Tree ID"];
  var fieldNumber = e.parameter["FField_Number"];
  var trialNO = e.parameter["Trial_Number"];
  var noBrunches = e.parameter["NO_Brunches"];
  var vacancy = e.parameter.Vacancy;
  var rotten = e.parameter.Rotten;
  var date = e.parameter.Date; 
  var timeScanned = e.parameter["time_scanned"];

  // Find or create a sheet for the date
  var sh = ss.getSheetByName(date);
  if (!sh) {
    // Create a new sheet if the date doesn't match an existing sheet
    sh = ss.insertSheet(date);
    // Add header row to the new sheet
    sh.appendRow(["Tree ID", "Field_Number", "Trial_Number", "NO_Brunches", "Vacancy", "Rotten", "Date", "time_scanned"]);
  }

  // Append the data to the sheet
  sh.appendRow([treeID, fieldNumber, trialNO, noBrunches, vacancy, rotten, date, timeScanned]);

  return ContentService.createTextOutput("Data berhasil diinput").setMimeType(ContentService.MimeType.TEXT);
}

Set the URL first and then the post.
The Google Sheet is not the best, nor effective, nor secure when it comes to sending data, the same thing happened to me, some of the data was sent and others were not, so I used a stopwatch with a few milliseconds.

Can you give me an example from the blocks still new here

use num variable+ timer component instead for each loop …
use increment that variable on every second with timer

You can do something like this,
or adapt it to your needs.

image

hey i have tried this but there is a duplication issue. how to fix it?

for an example it will update the spreadsheet multiple times to a point where there are many same data in the sheet