Community

If element is present, Put "Present" otherwise put "Not Present" Answered

How do I tell FlexiCapture, to give me a particular text if an element is found. Something like an if function.

If you find Signature, give output as Found...otherwise give output as not found.

Do I need to do that in the document definition?

Was this article helpful?

0 out of 0 found this helpful

Comments

3 comments

  • Avatar
    Vladimir Dimitrijević

    Hi,

    You will need to add a rule on Signature field (in document definition, yes).

    Best regards,
    Vladimir 

    0
  • Avatar
    Permanently deleted user

    Hello Vladimir,

     

    Many thanks for your response. I am a little new to ABBYY... Can you give me an example on  how to create that rule?

     

    Cheers,

    Kofi.

    0
  • Avatar
    Vladimir Dimitrijević

    Hello Kofi,

    It depends where exactly you need to show this message. Does this output needs to be shown during the verification, or you want to export that value in database only. If signature field is missing, do you need to throw an error in Verification or not? Depends on your exact requirement.

    I will make an example here, in case that you need to show this as Error message to Verification users:


    1. Open document definition, double click on Signature field and click on New Rule in Rules tab.
    2. Add name, set Severity to Error and set Apply rule to Always
    3. In Rule Settings tab, click on Edit and paste this code:

    string signature = Context.Field("Signature").Text;

    if(!string.IsNullOrEmpty(signature)) {
          Context.CheckSucceeded = true;
    }

    else {   
          Context.CheckSucceeded = false;
          Context.ErrorMessage = "Signature field is empty";
    }

     

    Best regards,
    Vladimir

    0

Please sign in to leave a comment.