The Cloud Studio brings a lot of new activities especially with the PDF Library.
In this blogpost, I will explain you how to retrieve data from a column of a table using Get Table Column Entries (PDF) activity.
We will use this table as sample:
In this case we want to retrieve the 3 columns. To do this we will use 3 times the activity Get Table Column Entries. But let’s focus on the first column.
For the basic usage of this activity we will use only the parameters columnHeader and textBelowTable :
In this case the activity will retrieve the data below the label “Material” until the position of the label “Date”. If you don’t fill textBelowTable the activity will retrieve all the labels until the end of the file.
In our case here is the section that the activity will cover:
We can see that the activity will retrieve data that are strictly between the position of the letters “M” and “L”. In our case this not what we want because the activity will retrieve nothing. For extend this, there is leftOffset and rightOffset parameters.
We saw the basic behavior of the activity, now we will see how to use offsets to retrieve our data.
The offset parameters are the number of offsets to add to the header label position:
In our case we want to add a leftoffset to retrieve our values.
With this we retrieve all the data of the material column :
So, we set 70 to retrieve the data. Now the question is how to guess the number of offsets to add?
Calculate the offset
We saw that sometimes we need to add offsets to retrieve column data. Now we will see how to calculate the number of offsets.
In order to retrieve our values, we need to calculate the left offset to add. We have to use the left position of the label Material and the left position of Items (or the label in the column).
Thanks to the activity Search Text items:
So 127.73-70.824= 56.906 we just round up and we have the leftOffset to add: 57.
You can also let the automation calculate this for you with an expression if you want.
Now you know how to retrieve data in a PDF table.