Need to Match show rows from a table if email field matches
Hello and good day!
I have a table called "Events" where I record emails from or to different Contacts.
I have a table called "Contacts" and I'm adding a view to this table where I want to show "Events" just if the fields EmailFrom or EmailTo are = to the Contacts table field called "WorkEmail".
I used the formula as shown in the screen but it is not recognizing the field "WorkEmail" which is available in the "Contacts" table:
I tried changing the formula to:
select Events where EmailTo or EmailFrom = (select Contacts).WorkEmail and it work, but i showing all Events that have a Contact = WorkEmail without filtering.
I need to show in Contacts only the Events where EmailFrom or EmailTo are equal to this specific contact WorkEmail.
Can please anyone help?
Hi Predro. Try this:
let me := this;
select Events where EmailTo or EmailFrom = me.WorkEmail
a bit of background to Fabio's great suggestion:
Your code was just missing a way for Ninox to access the current record you are in. Thus the first line of code is to tell Ninox to take the data from the current record (this) and put it in a variable (me). Then you can use the variable in your select statement and access the fields from the current record.
Hello Fabio and Fred!
Thanks for the assistance and help; I tried the code and the syntax is great but still the view is showing emails from the contact, but also showing other e-mails too.
See the red arrow, where the email was not supposed to be listed, below:
In fact I just checked, all Contacts are showing the same list; maybe the "me" := This is not been recognized?
This feature is very important for my project; I truly appreciate your kind help.
Please double check the record for 20 Apr 2021, 05:08 to see that the email address is not in either Emailto or EmailFrom.
Are you using email fields or text fields for EmailTo and EmailFrom?
Just checked and no; there is no repeating or associated emails in the fields that may be filtering to the same message.
I double checked all records.
I was wondering if your code was correct but it isn't. Please change it to:
select Events where EmailTo = me.WorkEmail or EmailFrom = me.WorkEmail
You were basically saying if EmailTo equal anything.
Fred, it works!
Thanks a lot for your assistance and support!
Wish you a great day, thank you!!!
- 2 yrs agoLast active