Page 1 of 1

Integer and email on insert

Posted: 2020-11-07 10:07
by fciprian
Hello

I need some support please.
I have set up to send me an email when a record is added.
Everything works well. BUT :) on a field that is Integer -> Lookup field is only showing me a number (the ID of the raw that i selected).

So i have :
ID Name
1 Ion Marin
2 Cercel Adrian
3 Andrei Victor

And on the email is shows me 2 (the ID). How can i search to table that is Integer and show me directly in email the Name?

Thank you

Re: Integer and email on insert

Posted: 2020-11-07 22:32
by aarlauskas
Put this at the beginning of your email script, new line for each lookup field (change parent table & field names accordingly). Lets say your field name is: employee

Code: Select all

$employee = sqlValue("select PARENT_FIELD_NAME from PARENT_TABLE_NAME where id='{$data['employee']}'");


Then where you have your current code for your field put this instead.

Code: Select all

"Employee Name: $employee \n" .

Re: Integer and email on insert

Posted: 2020-11-09 11:42
by fciprian
Thank you verrrrrryyyy muuuuuccccchhhhhh! :X
I have one more question.. please please please :X

So i have 2 fields with Check box. If it is checked in database is 1 and if it is not in 0.
How can i make in email to show me in sted of 1 to be shown YES and if it is 0 to be shown NO in the email ?

I apriciate your help!!!!

Re: Integer and email on insert

Posted: 2020-11-13 07:02
by onoehring
Hi,

try similar top aarlauskas solution (code not tested):

Code: Select all

$checkbox_word = (sqlValue("select CHECKBOX_FIELD from TABLE_NAME where id='{$data['selectedID']}'") == 1 ? 'Yes' : 'No';
Olaf