Anyone got a script to do data input?

I have a bunch of things that I want to put into a data input behind the scenes. I need to put in multiple lines.

I could script putting text into labels, then have a bunch of data input interactions on a button. I would prefer not to do this because I would need to have a data input that puts labels 1,2,3 into the cube, then another one for 4,5,6 etc. up to 24.

Does anyone have a script to put these values into these columns?

Thanks

1 Like

You can use the following method to insert records into the data input storage: DataInputService.insertDataStorageRecord Method

The following sample is using this exact method:
Data Input Sample

Specifically, you can see the script used under this sample here (note the bold line is where the insert takes place):

var recordId = dataLabel1.metricSetBindings[0].dataResult.cellset.rows[0].members[2].caption;
var customerId = dataLabel1.metricSetBindings[0].dataResult.cellset.rows[0].members[0].caption;
var selectedAction = ‘’;
for (i=0;i<dropDownList1.items.length;i++)
{
if (dropDownList1.items[i].isSelected)
{
selectedAction = dropDownList1.items[i]._caption;
}
}
var inputService = dundas.context.getService(“DataInputService”);
var del = inputService.deleteDataStorageRecord(“041163cf-c162-49df-b4e6-89293897f2d7”, “9049c9ed-6f1c-4d50-b664-6b919ecba836”, recordId);

del.done(function (message) {
var def = inputService.insertDataStorageRecord(“041163cf-c162-49df-b4e6-89293897f2d7”, “9049c9ed-6f1c-4d50-b664-6b919ecba836”, [selectedAction, customerId]);
def.done(function (message) {
// reload the scorecard
this.parentView.reset();
}.bind(this));
}.bind(this));

2 Likes

Thanks Ariel!