Welcome to the community, @Osher_Ezra! :grinning_face_with_big_eyes: I see the problem with your first issue. Say that the email
variable is set to bob@gmail.com
. Once inserted into that template, the resulting filter formula becomes this, which isn’t a valid formula:
{Email} = bob@gmail.com
The email needs to be represented in the formula as a string, so you’ll need to wrap quotes around the inserted variable value. Try this alternate version:
const record = await sheet.select({ filterByFormula: `"{Email} =\"${email}\""`}).firstPage()
That will turn the above filter formula into this, which is valid:
{Email} = "bob@gmail.com"
I’m not sure that I understand your second question. Could you please elaborate?