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

  • Last Post 15 January 2018
  • Topic Is Solved
KofiB posted this 11 January 2018

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?

Order By: Standard | Newest | Votes
Vladimir Dimitrijevic posted this 13 January 2018


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

Best regards,

KofiB posted this 15 January 2018

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?




Vladimir Dimitrijevic posted this 15 January 2018

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,