I have a user table that contains a column for first name and last name. How can I concatenate the 2 into Full name ?
Ex. First Name = John | Last Name = Doe > Display: Full Name = John Doe
I have a user table that contains a column for first name and last name. How can I concatenate the 2 into Full name ?
Ex. First Name = John | Last Name = Doe > Display: Full Name = John Doe
Hi Yusra,
By creating a smart field, you can do that
/forest/customers.js
const { collection } = require('forest-express-sequelize');
ā
collection('customers', {
fields: [{
field: 'fullname',
type: 'String',
get: (customer) => {
return customer.firstname + ' ' + customer.lastname;
}
}]
});
more details here: https://docs.forestadmin.com/documentation/reference-guide/fields/create-and-manage-smart-fields