Display data if a condition is true

How can I fetch data from a database to display on a text label on condition that the user email = email on the spreadsheet.

To put it in context, I have a spreadsheet with names and emails of people and I created a variable which stores the user email when they login. So I want to compare the stored user email and the email on the spreadsheet and if they match, I want to show the name which corresponds with the email on the spreadsheet on a text label.

Hi! If the saved email is appVars.userEmail and the spreadsheet is data.sheet with email and name fields, you can find the name corresponding to the saved email with the following formula:

FIND(data.sheet, item.email === appVars.userEmail).name

Thank you so much. This is exactly what I needed

1 Like