Hello!
I am trying to export data from 2 related models into 1 csv file.
I am using the exportData() function but I understand that it accepts only 1 model so I wondered if I should use a third Ui-Only model to populate the data before.
A test version of my current snippet would be:
var $ = skuid.$;
var model1 = skuid.model.getModel(‘Model 1’);
var model2 = skuid.model.getModel(‘Model 2’);
var fields = [
model1.getField(‘Id’),
model1.getField(‘Field1’),
model1.getField(‘Field2’),
Here is where I would like to include a new column using a field from model2 (related to model 1 via a lookup field)
];
model1.exportData({
fileName: ‘MyExportFile.csv’,
fields: fields
});
Many thanks,
Jesus