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

  • 48 Views
  • Last Post 2 days ago
  • Topic Is Solved
KofiB posted this 6 days ago

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 4 days ago

Hi,

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

Best regards,
Vladimir 

KofiB posted this 2 days ago

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.

Vladimir Dimitrijevic posted this 2 days ago

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

Close