Adding to a table from script

Hi,

I am extracting data for a table in the Javascript of an Action step.

function ParseDocumentData(number, value)
{
var dataCode = value.substring(0, 4);
var dataDesc = value.substring(6, value.length - 6);

var x = record.tables.Data;//[0];
x.Code = dataCode;
x.Data = dataDesc;

}

Here “record.tables.Data” is a table which I created in the record, I want to add the new detail record to it.

You can’t do it this way. Fields can only be added through an Extraction step. So, your Action script should simply set a Record variable of type Object like so:

sourceRecord.properties.myObject = {Code:"123", Data:"456"};

And then your Extraction step can set the Code field to

sourceRecord.properties.myObject.Code;

Thanks, I got this to work now.