I don't know why, but I just keep trying just in case and now it works. Below is the code that made it function.
/**
* Create a list.
* @customfunction
* @param name string
* @param args {string[][]}
*/
function datatablex(display: string, ...args: string[][][]): any {
const entity = {
type: "Entity",
text: display,
properties: {
Nombre: {
type: "String",
basicValue: display,
propertyMetadata: {
excludeFrom: {
cardView: true
}
}
}
}
};
for (let i = 0; i < args[0].length; i += 2) {
entity.properties[args[0][i + 0]] = {
type: "Array", // "String",
elements: args[0][i + 1] // basicValue: value
};
}
return entity;
};