Skip to Content
Technical Articles
Author's profile photo Julien LEONARD

SAP Intelligent RPA 2.0 – How to read table column data in PDF

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:

PDF%20sample

PDF 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. 

Basic usage: 

For the basic usage of this activity we will use only the parameters columnHeader and textBelowTable :  

Activity%20parameters

Activity parameters

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: 

Area%20covered%20by%20the%20activity

Area covered by the activity

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. 

Offset management: 

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: 

Usage%20of%20the%20leftoffset

Usage of the leftoffset

In our case we want to add a leftoffset to retrieve our values. 

Activity%20parameters%20with%20leftoffset

Activity parameters with leftOffset

With this we retrieve all the data of the material column : 

Output%20of%20the%20activity

Output of the activity

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: 

SearchText%20Items%20output%20for%20the%20label%20items

Search Text Items output for the label Items

Search%20Text%20Items%20output%20for%20the%20label%20Materials

Search Text Items output for the label Materials

Thanks to the timeline once you have tested your automation we can see that the left position of Material is 127.73 and the left position of Items is 70.824. 

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. 

Conclusion 

Now you know how to retrieve data in a PDF table.  

 

For more information on SAP Intelligent RPA

Assigned tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.