OL Learn

Text condition : Search many string values into a PDF area

Hello,

I would like to insert a text condition that search a string in a specific area of a PDF document.

In the example in attachment, we are looking for these references in the document.

“F/E14000003” OR “F/E15000079” OR “F/E15000090” OR “F/E15000091”

@johndoe many thanks for you help for finding theses values within an XML file, the target is the same here but into a PDF area. Using the same logic is not working, I don not understand where is my mistake.

Regards,

Your condition is looking for the literal string “F/E14000003|F/E15000079|F/E15000090|F/E15000091”

You’re going to need multiple conditions to handle the equivalent of an OR statement. Something like this:

That gets messy though for huge conditions like this and means the rest of your process would also end up as a Subprocess that’s referenced by each branch.

So instead, you could use a scripted condition. If you drag a Run Script out onto the workflow, you’ll get this option.

Capture2

With this you’ll run the condition using VBscript or JScript logic and then you’ll use the Script.ReturnValue to control the flow back in the workflow. There’s an example of that here: https://help.objectiflune.com/en/planetpress-workflow-user-guide/2019.2/#Workflow/Scripts/ScriptReturnValue.html

As already mentioned, this is not the same and will not work.

If you are certain that your area in the PDF does not contain multiple lines you could still use a text condition but in a slightly different manner. Extract that area to a variable (eg. ‘area’) using Set Job Infos and Get Data Location. Then in the condition:
String: |opt1|opt2|opt3|
Operator: contains the string
Compare to string: %{area}

Ok perfect, I tried both of your proposals and both works. Thanks a lot