All Classes Namespaces Functions Properties Pages
Update Values and Properties of Document Fields

This page describes how to update values and properties of document fields.

The following code is a sample of updating values and properties of three fields of the document identified by Document ID.

This code includes the following parameters:

Sample code for UpdateDocumentFieldPropertyValues:

1 public void UpdateDocumentFieldPropertyValuesSample(string sessionId, string docId, string field1,
2  string field1Value, string field1Error, string field2, string field2Value, bool field2ExtractionConfident,
3  string field3, int field3Row, int field3Col, string field3Value, string field3Width)
4 {
5  var cds = new sdk.CaptureDocumentService();
6 
7  try
8  {
9  // Update the given system field.
10  cds.UpdateDocumentFieldPropertyValues(sessionId, null, docId, new FieldPropertiesCollection {
11  new FieldProperties {
12  Identity = new RuntimeFieldIdentity(field1),
13  PropertyCollection = new FieldSystemPropertyCollection {
14  new FieldSystemProperty {
15  SystemFieldIdentity = new FieldSystemPropertyIdentity {
16  Name = "Value"
17  },
18  Value = field1Value
19  },
20  new FieldSystemProperty {
21  SystemFieldIdentity = new FieldSystemPropertyIdentity {
22  Name = "ErrorDescription"
23  },
24  Value = field1Error
25  }
26  }
27  },
28  new FieldProperties {
29  Identity = new RuntimeFieldIdentity(field2),
30  PropertyCollection = new FieldSystemPropertyCollection {
31  new FieldSystemProperty {
32  SystemFieldIdentity = new FieldSystemPropertyIdentity {
33  Name = "Value"
34  },
35  Value = field2Value
36  },
37  new FieldSystemProperty {
38  SystemFieldIdentity = new FieldSystemPropertyIdentity {
39  Name = "ExtractionConfident"
40  },
41  Value = field2ExtractionConfident
42  }
43  }
44  },
45  new FieldProperties {
46  Identity = new RuntimeFieldIdentity(field3, field3Row, field3Col),
47  PropertyCollection = new FieldSystemPropertyCollection {
48  new FieldSystemProperty {
49  SystemFieldIdentity = new FieldSystemPropertyIdentity {
50  Name = "Value"
51  },
52  Value = field3Value
53  },
54  new FieldSystemProperty {
55  SystemFieldIdentity = new FieldSystemPropertyIdentity {
56  Name = "Width"
57  },
58  Value = field3Width
59  }
60  }
61  }
62  });
63  }
64  catch (Exception ex)
65  {
66  // Unhandled exceptions will terminate processing from progressing through the remaining nodes on the process map.
67  throw;
68  }
69 }