demellor

Retrieving Field Values

0 votes

We have forms that we need to retrieve the values from but not all fields are required.  WHen I use the FieldSummaryService.GetFieldSummary the blank fields are dropped instead of returning "" so no fields are missed.  How do I obtain values for all fields even the blank ones.  I'm using c# .NET

Richard DeMello


Reply to: Retrieving Field Values

0 votes

Hi Richard,

 

Due to the nature of the Field Summary API, it only returns fields where signer has input values. To obtain values for all fields even the blank ones, you may have to retrieve the complete package object and loop through the fields list like below:

            DocumentPackage pkg = eslClient.GetPackage(new PackageId("HkHNdgqUkd313II7pB8chyCpep0="));
            foreach (var document in pkg.Documents) {
                foreach (var signature in document.Signatures) {
                    foreach (var field in signature.Fields) {
                        Debug.WriteLine($"field id: {field.Id}; field signer: {signature.SignerEmail}; field value: {field.Value}");
                    }
                }
            }

Image removed.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Retrieving Field Values

0 votes

I just started using this now that the user has finished their project.  Should I expect the fields from the FastTrack to always be in the same order when I extract them?  Are the fields saved in the order they are displayed, tabbed though, filled in or some other order?  Thank you

Richard DeMello


Reply to: Retrieving Field Values

0 votes

Hi Richard,

 

Sorry for the late reply! Which method are you using to extract the field values? FieldSummaryService.GetFieldSummary or the way I suggested above? Either way, I found the fields are returned in alphabetical order according to the field ID. However, it's always better to uniquely reference a field by mapping its field ID or Name, instead of replying on the order.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off