Search in strings by unique value

i have the following code:

FIO1 = input("Enter last name: ")
if FIO1 == “Smith”:
rows = base.list_rows(“Employees”)
if (rows[0][‘_id’]) == “SxWKu1-ATzaNGt9Y4LN8qw”:

and this code works fine, but I don’t want to be tied to a specific index, so I’m trying to slice from index zero to the end of the list:

if (rows[0:][‘_id’]) == “SxWKu1-ATzaNGt9Y4LN8qw”:

then I get an error:
TypeError: list indices must be integers or slices, not str
Can’t SeaTable work with slices?

As the error say, you have a syntax error in your Python code:

  • rows[0:] is a list, you cannot use [‘_id’] on the list.
  • while row[0] is the first element in the list, it is an object, you can use object[‘_id’] to get the field value of an object.

Can you please tell me how to initialize rows by unique value? I would not like to be tied to the ordinal number of the element in the list, since the order of the elements can change