Checking PDF string for list of codes

Hello - I am currently creating some automation where I am reading a PDF and outputting a string. I need to check if the string contains anyone of the below codes. There is also a possibility that more than one code may exist.

Is there any cleaver way I can check for any combination of the below codes without trying to hard code a big list of possible scenarios?

The codes:
INO1
INO3
INOW
INO2
INO4
INO5
INO6
INO7
INO9
INO10
INON

Hi,

how about this:

  • write the list of codes into an excel file, so you can modify the list easily
  • read the excel file with read range and get a datatable with one column containing the codes
  • add a column to indicate if that code exists in your pdf string
  • use for each row on your datatable to check if the current code exists in the pdf
  • example: PdfString.Contains(row("ColumnCode").ToString)
  • indicate that the code exists in your pdf in your previously added column (true/false)
  • filter your datatable on that column and return only the codes that exist

Now you have a filtered list of codes that exist in that pdf string and you can easily add new codes without ever touching the workflow itself.

Does this help?

Good Idea. Thank you. This will work

1 Like

I would just suggest to create a Data Table directly, there is no need of reading csv.

Actually there is a need for not hardcoding the values in the UiPath project but instead using an external list like an excel file or an Orchestrator asset.

When changes to the list need to be made and you have the values hardcoded in the project, you might need to republish that project to Orchestrator. That can come with a lot of work if you are trying to be very compliant and need to review, test and validate new project versions.

Actually Bob himself stated the need for not hardcoding the values:

Use assets outside of your project if you expect changes, it will save you a lot of time in the long run :wink:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.