Community

Detecting the percentage of empty/no-response fields in a fixed document before verification stage Answered

Occasionally respondents will mail in blank questionnaires (none of the fields are filled, no data to capture)

These blank questionnaires are processed in the same batches as filled questionnaires

It will soon be a requirement to report blank questionnaires to outgoing mail ASAP to avoid re-mailing questionnaires to respondents who do not fill them out

I would like to configure workflow to detect empty documents and send them to a separate stage or batch where their status as an empty document can be confirmed, and data about the document's respondent can be recorded

Here's what I would like:

  • 1: Batches of questionnaires are imported and recognized
  • 2: Fix any assembly and matching errors manually
  • 3a: If less than 90% of a document's fields are empty, send document to regular verification stage where the rest of the batch can be processed normally (VS0) 
  • 3b: If more than 90% of a document's fields are empty, send document to a special verification stage (VS1)
  • 4a: (VS0) All documents are verified and sent to the regular export stage
  • 4b: (VS1) Documents in this queue are verified to be empty and the respondent data is recorded separately from VS0

If we could send empty documents to a separate batch instead of a separate verification stage that would be better

0

Comments

7 comments

  • Avatar
    Matthew Harper

    Here's what I've come up with so far (this is still untested):

    Create a verification stage after recognition for assembly only

    Create a custom processing stage following the assembly stage with the following script

    //Jscript//

    var EmptyCount;
    var FieldCount;
    var emptyUB = 0.9;

    for(var doc in this.Batch.Documents){
        EmptyCount = 0;
        FieldCount = 0;

        for(var sec in doc.Children){
            for(var fd in sec.Children){
                if(Field(fd.Name).Text == ""){
                    EmptyCount++;
                    }
                    FieldCount++;
                }


        }
        if((EmptyCount/FieldCount) > emptyUB){
            var serverpath = 'ServerPathName';
            var BName = doc.batch;
            var docId = doc.Id;

            doc.SaveAs(serverpath+BName+docId);
            }

    }

    Does anybody see anything in here that could cause problems?

    0
  • Avatar
    Ekaterina

    Hello,

    To separate documents by there fields you may use the routing rules (Appendix > Using scripts in ABBYY FlexiCapture > Scripts for customizing processing stages > Objects > IRoutingRuleResult) or the registration parameters (Using scripts in ABBYY FlexiCapture > Scripts for customizing processing stages > Objects > IProperties).

    For example you may do the following:

    Create a new stage where add to your documents the registration parameters depending on the fields filling (use "Document.Properties.Set(name, value)" construction). Then in the "Exit Routes" tab you may custom conditions for sending documents  to desired stage: Choose the stage in the drop-down list, click to the "Stage" button and write the script rule which use the created registration parameters.

    0
  • Avatar
    Matthew Harper

    Thanks! I'll give this a try and see if it's a working solution for my problem

    0
  • Avatar
    Matthew Harper

    Is there an easy or singular method to determine if a field has no response (for text fields), not selected (for checkmarks) or no items selected (checkmark groups)? If there isn't I'll have to write my own, I've needed to know this so many times

     

    0
  • Avatar
    Ekaterina

    Hello

    I may offer you to use “cannot be blank” option (the field properties > Data > the Validation block) for text fields and “allow empty selection” checkmark for checkmark group fields.

    0
  • Avatar
    Matthew Harper

    I'm aware of those field properties, but I don't want to force the fields to be empty. I want to check if the fields are empty in a custom processing stage, then route documents based on the number of empty fields

     

     

    0
  • Avatar
    Matthew Harper

    It works! thanks all!

     

     

    0

Please sign in to leave a comment.