Skip to content

Instantly share code, notes, and snippets.

@raganmd
Last active November 11, 2023 03:40
Show Gist options
  • Save raganmd/f663f8f77a1e9179358b22a4575af1f4 to your computer and use it in GitHub Desktop.
Save raganmd/f663f8f77a1e9179358b22a4575af1f4 to your computer and use it in GitHub Desktop.
col-to-list-as-lookup.py
# this will return a list of cell objects
raw_col_data = op("table1").col(0)
print(raw_col_data)
# we can then create a list of only the values with a comprehension
col_as_list = [each.val for each in raw_col_data]
print(col_as_list)
# this is a placeholder for your new uuid
new_row_uuid = "0124_7:30"
if new_row_uuid in col_as_list:
# skip data that's a duplicate
print("duplicate, skipping")
else:
# add the data if it's not in the list
print("adding new data")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment