Why is Smartsheet only adding one blank row instead of all the rows it read from G-sheet?


Hi, I'm trying to make a script from Apps Script to work with Smartsheet and I'm stuck.

The script is to process some rows that need to be copied to a specific Smartsheet based on some filtering criteria, but after the script runs, we can see the following.

Is there anything that might be preventing Smartsheet from pasting the values as expected?

  1. Headers Found: The headers from the Google Sheet are correctly read and logged.
  2. Data Read: The data from the Google Sheet is read correctly and logged.
  3. Filtering: Rows are filtered based on the batch number, and the filtered rows are logged to confirm that the filter is working as intended.
  4. Mapping: Each row's data is mapped to the corresponding Smartsheet column IDs, and the mapping is logged for each header. The logs indicate that the mapping process is working correctly for each row.
  5. Payload Creation: The full payload being sent to Smartsheet is logged and appears to be structured correctly, with an array of rows, each containing an array of cells with column IDs and values.
  6. API Response: The response from the Smartsheet API is logged, showing a response code of 200, which means the request was successful. The response body indicates "SUCCESS" with no errors reported.
  7. Parsed Response: The response body is parsed and logged, confirming the successful addition of rows.

I'm attaching the script here with the sensitive information ommited.