An error appears that I cannot change the Dataset type for datatable because Stric option is on
There is no strict option. That’s just an internal error message thing.
If DataSetResults.Tables(0) is a datatable, then you need to be using For Each Row in Datatable, not For Each.
But if you’re trying to write a datatable to an Excel file, you don’t loop through the datatable and do Write Range for each row in the datatabe. Just pass the entire datatable to Write Range. In other words, get rid of your For Each and just put DataSetResults.Tables(0) where you have currentItem. You also have to designate the Sheet Name and starting cell (ie A1 if you want it to start writing in the first row first column).
It looks like you want only write 1 table to Excel
So use DataSetVar.Tables(0) directly within the write range without a for each
Thanks I am testing to see how it works now
I suggest doing the free training on the UiPath Academy web page. It teaches you these kind of basic things. There is specifically a class on Excel automation.
You can directly give the DataSetResults.Tables(0) in the currentItem place that you have given in the write range workbook activity. You can directly pass with out for each.
Delete the for each activity.
If you are extracting the data using document understanding. The data is stored in dataset of index 0.
DataSetResults.Tables(0)
If you are extracting the datatable using document understanding. The datatable is stored in dataset of index 2.
DataSetResults.Tables(2).
Hope it helps!!
Yeah I know,but I’m trying to build an “Invoice extractor” and Im just getting used to the new activities and data types
Thanks a lot @mkankatala,
If you have any tips on how to do the same but for every invoice in a folder that would help a lot.
There is no need of for each in this you can directly do this by using write range workbook
arr=Directory.GetFiles(“Folder”,“*.pdf”)
Load Taxonomy
For each loop
If you want to same data fields from different invoices
Use merge datatable activity
Outside the for each use write range activity
Okay @Gonzalo_Delclaux
If all invoices are in one folder then store the invoices in a Array of String.
Create a datatable with build datatable activity and add the columns based on your requirement. Output - BuildDatatable (Datatable datatype)
At the start of the project insert a assign activity, Create a array of string variable say InvoiceFiles
- Assign -> InvoiceFiles = Directory.GetFiles("Folder Path","*.pdf)
After assign use for each activity to iterate the files in the above array of String InvoiceFiles variable.
Inside for each insert all the DU activities, in the place of file path give the CurrentItem of For each output.
At last, after the Export extraction results activity, output is dataset datatype variable lets say Dataset.
After Export extraction results activity, use merge datatable activity to merge all the data in the BuildDatatable.
Out of the For each activity use write range workbook activity to write the BuildDatatable to the excel file.
Hope you understand!!
Ok yeah I think I understood
What about if I want to present a Validation station for all of the invoices?
Because an really weird error appears here too
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.