Hello there
Following the tutorial on https://support.wix.com/en/article/velo-tutorial-calculating-and-displaying-collection-data I have a table, that I want to fill with data from a collection. It works and populates a column with a field from my collection:
$w.onReady(function () {
const currentColumns = $w("#table1").columns;
const calculatedColumns = [
{
"id": "colFullName",
"dataPath": "memberlink.customfields_system_firstname",
"label": "Fullname",
"type": "string",
},
];
$w("#table1").columns = calculatedColumns.concat(currentColumns);
});
However, what I want to do and the reasons I’m doing this is that I want to display a column with a fullname of the persons from the collection, that means firstname and lastname combined.
Is this even possible? The second field key is memberlink.customfields_system_lastname. I tried to concatenate these fields like
"memberlink.customfields_system_firstname" + " " "memberlink.customfields_system_lastname" or
"memberlink.customfields_system_firstname\" + \" \" \"memberlink.customfields_system_lastname" or
['memberlink.customfields_system_firstname'] + [ ] + ['memberlink.customfields_system_lastname']" etc....
and several other combinations, but it did now work out.
Do I have the wrong syntax, or is it even not possible to concatenate fields in the 'columns" element. And if yes, what would be an option to solve the problem of a ‘FullName’ column?
Many thanks for any help in advance,
Micharius