a-marenkov / gsheets

A Dart library for working with Google Sheets API.
Other
79 stars 31 forks source link

Get row index by value #7

Closed fabfaby closed 4 years ago

fabfaby commented 4 years ago

Is there a way to get the index of the row by searching a column for a certain value?

a-marenkov commented 4 years ago

@fabfaby

Hi! Thanks for checking out gsheets library!

Yes, try using rowIndexOf.

await sheet.values.rowIndexOf('some value', inColumn: 2);

Here is the link to doc https://pub.dev/documentation/gsheets/latest/gsheets/WorksheetAsValues/rowIndexOf.html

fabfaby commented 4 years ago

Perfect, exactly what I was looking for.. :-)