Customize field features using script

Team, we are extracting data from insurance documents. It was extracting properly. Need to check few things, whether its possible or not. Please help.

1. We are extracting State_ code from PDF like AL, CO etc., We need to convert this state code into state name Like NY to New York. So, if state_ field extract NY in State field it will reflect as New York.(Refer State screenshot) Is this possible? if yes, please share sample scripts.

We have tried this : var s=Field("State_").Value.Text;
var p=Field("State").Value.Text;
var x=p.substring(p.length -2, p.length);
}} .

But we are unable to do that. Please guide.

2. We are capturing location number for location details its a repeating section. The location number will be captured using layout and there is no issues. If verifier needs to add new location section, we need that location number should automatically increment the values comparing with other location numbers in location section. For example if there is 3 location, Location 2, 3 and 1. If validator clicking add new location, the location number field should be 4.

We tried this, script :

using System;

int LineItemCount = Context.Field("Checking").Items.Count;

for (int i = 0; i < LineItemCount; i++){

Context.Field("Checking").Items[i].Value = Convert.ToString(i+1);


But its default increment the value 1,2,3.. not as per the above requirement. Please help.



1 comment

Please sign in to leave a comment.