How can I find out the row number in GoogleTable?

Hello community! How can I find out the row number in GoogleTable if I know the key (“uuid”) unique identifier of the row?
Google Таблицы - Google Chrome 2021

Hey @Roket,

You can use the following code snippet

const uuid = 2;

const rowNumber = items.findIndex(i=> i.json['uuid']===uuid)+2;


return [{json:{rowNumber}}];

You will have to update the value for uuid. This can be the uuid you want to return the row number for.

Also, you can notice that I am adding the returned value with 2. The reason for this is that since it is an array, it starts with the index 0 (your first row becomes 0, the second row becomes 1, and so on). The first row in your sheet contains the column names, hence we need to consider that value as well.

I hope this is helpful.

1 Like

@harshil1712, Thanks for the quick response! I will check later and report the result.

Hey @Roket,

Did the solution work for you? Let me know if you still need help :slight_smile:

@harshil1712, hey! No, it didn’t work, but I’m doing other tasks now, so I didn’t focus on this problem (I solved this problem differently). No help needed at this time, thanks.

Thanks for letting me know. If you can share your solution that would be wonderful! It will help others with the same issue find the solution faster :slight_smile:

Ok, but my solution is outside of n8n). I made a fixed line ordering structure on the input, so the problem disappeared by itself.