I need to replicate a function that I’m currently performing in PP7.
I have a PDF file that has a value on the first page that I need to extract.
The information is in a general area or range, but can shift around a bit.
Typically plus or minus 1.5 inches up or down.
The line I need to capture is always prefixed with a static text tag (i.e. “Attention:”)
I’m selecting the region and then split the region into sub-fields.
I wrote a small javascript to search the sub-fields to locate which one includes the static text tag.
The next step is to populate a field with the actual value minus the static text tag.
I right clicked on the record table in the data model and selected Add Field.
When I go back to my script and type “record.fields.”, my new field does not show up in the list
How do I address this index field from javascript (I’m using an action)?
Must be just a refresh issue, because it works on my end.
That said, it seems to me you’re going through an awful lot of steps to achieve this.
I would extract the entire block of text as a single field, and in its Post function, I would write:
replace("Attention:<br />","")
That would eliminate the static tag and your entire field would be usable without any further manipulation.
I have 2020.2 and if I add the variable by clicking on the data model the field does not show up as available in javascript. However if I add a javascript field from an extract step it does show up as available.
Regarding my data (PDF) in the region defined.
I have multiple lines of text which vary between documents.
I need to grab the line that includes "Attention: " only so the value would be 12345678 using my examples.
Document #1
Line #1
Line #2 “PO Number: 887654”
Line #3 “Attention: 12345678”
Line #4 “Branch: LWZ”
Line #5 “Country: CA”
Line #6 “Division: 031”
Document #2
Line #1
Line #2
Line #3
Line #4 “Attention: 12345678”
Line #5 “Division: 066”
Line #6 “Country: NZ”
Document #3
Line #1 “Attention: 12345678”
Line #2 “Country: AU”
Line #3 “Division: 102”
Line #4 “Branch: TMP”
Line #5
Line #6
Document #4
Line #1 “Country: US”
Line #2 “Division: 004”
Line #3 “Branch: BBR”
Line #4 “PO Number: NS00234”
Line #5 “Attention: 12345678”
Line #6
The replace is how I’m removing the "Attention: ".
Because the lines may or may not be present I’m using a Try Catch
I need to use the value from the line and pass it to the workflow to used.
There isn’t a template involved in this situation.