Skip to main content
Kofax

Kofax TotalAgility - How to update a line number column in a capture table at process level

Goal

I would like to update a line number column in a capture table at process level. The line number values are not extracted from the document so have to be added programmatically.

How to..

Please find below the sample .NET code calling the UpdateDocumentFieldValues() SDK to update a line number column at the process level:

     public void MyUpdateDocumentFieldValueSample(string sessionId, string docId)
            {
                var cds = new sdk.CaptureDocumentService();
     
                RuntimeFieldCollection rfc = new RuntimeFieldCollection();
                TableFieldIdentity tfi = new TableFieldIdentity();
                tfi.Name = "LineItems";
                DataSet ds = cds.GetDocumentTableFieldValue(sessionId, null, docId, tfi);
                DataTable dt = ds.Tables[0];
     
                int lines = 0;
     
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    lines++;
                    rfc.Add(new RuntimeField() { Name = "LineItems", TableColumn = 5, TableRow = i, Value = lines.ToString() });
                }
     
                cds.UpdateDocumentFieldValues(sessionId, null, docId, rfc);
     
            }

  • A new column (position 5) into the Capture Starter Pack Northwest document class.   (TableColumn can be changed as desired)
  • Then a .NET node calling the above method to the Capture Starter Pack process after Validation.
  • Then a loop node to call the method for each document in the folder.

Screenshots

clipboard_e3bd6755cd3d700eb2bde20da6d508293.png

clipboard_ef1026bcf43634e2f653e4c8f9e195d21.png

 

clipboard_e2e92aa31de565a3294e0f8005be8a7f9.png

 

When job completed, the lineItem LineNum column was updated successfully.

 

clipboard_e8785fc54edbd7ccae7d9d11d2298f74c.png

Applies to..

KTA 7.3 or above