SAP Process Automation: Demo for Splitting a PDF into multiple PDF’s and Extracting data from it using ‘split PDF’ and ‘Pre-Trained Model’ Activities.
We all know that many business receiving multiple invoices over email,it is very tedious and time-consuming task to process numerous Invoices sometimes leading to human errors as well. so in this blog We are going to see how easily we can Extract the data from invoice samples and store it in Excel sheet using SAP Process Automation.
Now we are going to see how to Split a PDF Document into multiple PDF Documents and Extract the data from the Invoice PDF samples in SAP Intelligent RPA.
We are going to use “Split PDF Every X Pages” Activity to split a PDF and “Extract Data(pre trained Model)” Activity to Extract Data from Invoice samples.
We need to follow some steps to create and Flow the BOT
- The First step would be login to SAP Intelligent RPA Cloud factory, go to the projects tab and create a new project.
Fig1.1: Add project name.
- Enter the project name and description then click on create. This will create a project and the project is opened in a new window.
Fig1.2:New project window.
- Click on the plus icon under Artifacts then click on create and Automation.
- Provide the name of the automation and description in the pop-up window and click on create.
- This will create automation with an empty workflow.
Fig1.5:New Automation Window.
- Make sure that the below dependencies are added to your automation project.
- Next Drag and drop “Get File Collection” from Activities and give the folder path in which PDF is saved.
Fig1.7:Adding Get File Collection Activity.
- Drag and drop the “For Each” from the Activities and give the output parameter of “Get File Collection” as input to “For Each”.
- Drag and drop ”Split PDF Every x Pages” from Activities inside the “For Each” loop.
- For the ‘Inputfilepath’ give the path of the folder in which the PDF needs to be split are stored.
- For ‘outputfilepath’ give the path of the folder in which split pdf will be stored.
Fig1.8:Adding Split PDF Every X page Activity.
- Next drag and drop the “Open Excel Instance” to Access the Excel page that is created to store the Extracted Data.
- Drag and drop “Open Workbook” and give the path of the Excel Page.
- “Set Active cell” activity is added to set cell number ‘A1’ as active cell.
- ‘Push InvNumheader’, ‘Push InvDateHeader’ and ‘Push InvAmount’ are used to add the Column names in the Excel Sheet using ‘Push Value’ Activities.
- Set second row in the first column as the active cell using “Set active cell” activity.
- Drag and drop the “Get File Collection-2” and give the path of folder in which split pdf are present to the input parameter.
- Drag and drop the “For Each” loop to access all the Split PDF.
Fig1.8:Activating Excel Page.
- Drag and drop the “Extract Data (Pre-Trained Model)”.
Fig1.8:Adding Extract Data(Pre-Trained Model) Activity.
- Enter the document path as shown below.
Fig1.9:Extract Data(Pre-Trained Model) Expression Window.
- Data values are pushed into the excel one by one using the “Push value” activity.
- After every data record that’s been filled, get the row number, and set the active cell to the first column of the next row.
- Then the input to the log message.
Fig1.10:Log Message Experssion Window.
- We can see the output in Excel sheet as shown below.
Here is the project demo video:
Be the first to leave a comment
You must be Logged on to comment or reply to a post.