Pulling OCR data - Wildcards?

Jozef_783863
Jozef_783863 Posts: 331 admin

Hello Catalytic,

I hope you all are doing well!

I'm pulling data from OCR into a table. From there I am using "Tables: Apply filters" to pull the rows of data that I will need by referencing the strings within the blocks.

I have one block that has a date that will change followed by two words that will never change. Is there a wildcard character I can use so it will take any data followed by the two words.

Ex. 01/01/2018 Static Words

02/01/2018 Static Words

I would like to pull the block that contains "thedate Static Words" regardless of what the date is.

Thanks!

Best Answer

  • Thomas_937381
    Thomas_937381 Posts: 196
    Answer ✓

    Hi @Jozef_catalytic

    The Tables: Apply filters needs to be paired with a few others for your use case. There are broadly two options, outlined below.

    The first is to use the following sequence:

    1. Tables: Add a column
    2. This is to add a placeholder Filter column to your table; you can set it as BOOLEAN in the action configuration.
    3. Tables: Apply formulas to column
    4. Update your column name where it says enter-your-column-name-here and the below Javascript will check your date value to see if "Static Words" is contained therein. This will record true to the Filter column if present in the string, and false if not.

    if (columns['enter-your-column-name-here'].includes('Static Words')) {

    result = true } else {

    result = false }

    columns['Filter'] = result

    1. Tables: Apply filters
    2. Use this action to filter on your Filter column for true values.

    The second option may be to use the horizontal scan output from your Images: Optical character recognition (OCR) step. This paired with Text: Find words that match a pattern could also work.

    Please let us know how this works out for you.