Category: How do I do X?
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

Reading data length and adding

Issue

I added data to a Google Sheet and assigned it a request ID in a JSObject. However, when checking the data length and adding 1, the result was too small. I tried running a query before fetching the length, but the result was still incorrect. Eventually, I realized the issue was with the data itself and resolved it.

Resolution

The issue was with the data being added to the Google sheet, which was causing the calculation for the length of the data to be incorrect. The solution involved running the query before fetching the length and adding 1. The updated code looked like this:

addRequest: async () => {
await get_requestors.run();
const data = get_requestors.data.length + 1;
}

However, the issue was later resolved as it was found to be an issue with the data itself, so the code did not need to be modified further.