Last Row in Google Sheet Retrieval

Hey guys,
I’m trying to update a Google sheet with the last message received from my ChatGPT module.
However, I am running into an error that says “Failed to map ‘rowNumber’: Function ‘last’ finished with error! ‘2’ is not a valid array.”

I tried using the last() function on the array.

Here are the screen shots to add more context:


What are your suggestions?

Cant wait to hear back!

LETS GOOOOO!

Hi @Cameron_Williams,

The error “Failed to map ‘rowNumber’: Function ‘last’ finished with error! ‘2’ is not a valid array.” usually means that the last() function is being applied to a value that isn’t recognized as an array.

To clarify your goal:

  • If you want to add the last message from ChatGPT as a new row in Google Sheets, you should use the “Create Row” action rather than trying to update a specific row number.
  • If you want to update the last row in your sheet, then using last() won’t work for getting the row number. Instead, you should use the length of the array (e.g., length(array)) to get the index of the last row.

Please let me know your exact goal, or share your automation setup steps so I can provide more precise guidance.

If you need any further assistance, feel free to ask. If this helps, please consider marking it as the solution. :+1:

Thanks for your repsonse.

  • I am using Google Sheets as an AI Memory of my leads conversation.
  • I guess the create a row wouldn’t hurt but its just not so easy on the eyes. Lol.
    -When storing information I like to keep things as linear as possible. It helps me explain to the business owner as well.