How to compare the Useremail to a table that has emails, to show the corresponding name of that user?

I am having trouble comparing the current useremail() who is logged in, to the table i built that has all emails, along with corresponding names.

Table 1 (Payables)
Table 2 (Initial Table)

I need to compare the current email user with Table 2 emails - and show the corresponding name of that email user.

Solved Solved
0 4 1,252
1 ACCEPTED SOLUTION

When it says โ€˜one randomlyโ€™, it really means it is taking the first item from the returned list. However, in this case, the returned list should only have one entry: that entry which the column [Email] matches USEREMAIL(). Therefore, the โ€˜one randomlyโ€™ statement isnโ€™t a concern.

Itโ€™s not immediately obvious why @tvinciโ€™s expression isnโ€™t working - it appears correct. Make sure that:

  1. Your application requires login, otherwise USEREMAIL() does not return anything;
  2. The table and column names are correct.

Also, an equivalent way to write the lookup statement would be:

ANY(
  SELECT(Initial Table[Name],
    [Email] = USEREMAIL()
  )
)

View solution in original post

4 REPLIES 4

tvinci
New Member

lookup(useremail(),
โ€œTable Nameโ€,
โ€œEmail Columnโ€,
โ€œColumn you want to returnโ€)

Ok. I tried that. It still is not showing the [Name] from Table 2 - associated with the current useremail:

When it says โ€˜one randomlyโ€™, it really means it is taking the first item from the returned list. However, in this case, the returned list should only have one entry: that entry which the column [Email] matches USEREMAIL(). Therefore, the โ€˜one randomlyโ€™ statement isnโ€™t a concern.

Itโ€™s not immediately obvious why @tvinciโ€™s expression isnโ€™t working - it appears correct. Make sure that:

  1. Your application requires login, otherwise USEREMAIL() does not return anything;
  2. The table and column names are correct.

Also, an equivalent way to write the lookup statement would be:

ANY(
  SELECT(Initial Table[Name],
    [Email] = USEREMAIL()
  )
)

NM. It is working. Sorry - i am not sure why i didnโ€™t see it earlier.

Thank you so much.

Top Labels in this Space