Adding result rows to a run

LabKey Support Forum (Inactive)
Adding result rows to a run kevink  2014-07-01 16:09
Status: Closed
 
Hi Will,

For file-based module assays, you can use the LABKEY.Experiment.saveBatch() method to add new data rows to an existing assay run. The saveBatch() API take a batch aka LABKEY.Exp.RunGroup object that contains an array of runs each of which contains an array of dataRows. For example, to add new data results to an existing run:

var assayId = <id of the assay>;
var batchId = <id of the batch previously imported>;

LABKEY.Experiment.loadBatch({
assayId: assayId,
batchId: batchId,
success: function (batch) {
// add a result row to an existing run
var row = {mydata: 100};
batch.runs[0].dataRows.push(row);

LABKEY.Experiment.saveBatch({
assayId: assayId,
batch: batch,
success: function (updatedBatch) { … }
});
}
});

For more on writing file-based module assays, see: https://www.labkey.org/wiki/home/Documentation/page.view?name=moduleassay

We'd love to follow up about the various different approaches to developing assays -- I'll send you an email off the board.

Thanks, Kevin