servoy 4 calculation using value from database

var test_email = login + “@mydomain.com”;
return test_email;

this code does not work???

login is a field in the table and has a value of fred.
the calculation above returns nothing

When I do this!

var test_email = utils.srtingtrim(login) + “@mydomain.com”;
return test_email;
this calculation returns fred@mydomain.com;

is there a way to run the calculation without the trim?

So, to completely understand.
Make sure that we help you with what really seems to be your problem…

You are trying to make a calculation work?
login is a column in your table?
login really exists and has a value?

Please, please be more specific!!!
Many on the forum, if not all, try to help you voluntarily.
So help us to help you by asking a question instead of making a puzzle…

– original post was edited by poster –

what datatype is the calculation set to?
and what datatype has the column login?

btw I would always check that login is not null!

the calculation is set to datatype text
the login column is text

how do you check for null before calculating?

thank you for you help

if (login == null) {

}

is ok or

if (!login) {

}

will check that login is not null and not “” (or 0 if int/number)

Have you tested with only one record or more?

This really should work.

What when you re-enter ‘fred’