Bank Statement & Casbook Comparison

Hi All,

Good Day!

Currently I’m practicing on Bank Reconciliation sample use project. First i had build the Data Table for both Bank Statement and Cashbook. Then i need to compare the Bank statement (using for each) with cash book. If the statement is equal then i need to store it “RecordExist” DT using Add Row. If it’s not equal then it’ll be store in “RecordNotExist” DT. When i run the program i’m getting an error message like as below. Please advise.
Condition Block.

Array Row in DataRow

Can you show the properties selected for the Add Data Row activity? It suggests that what you are trying to input to the datatable is being restricted due to datatypes

Hi I’m Unable to share the screen shot of property window. When i tried to upload it an error message occurred as "AWS Key ID doesn’t exist. In the DataTable sec i had updated BankRecordExist DT which build initially for stored the BankRecordExist in Build DataTable.

on your row items, put a ‘tostring’ suffix and see if that resolves the issue. so:

row.item(“Cheque/Ref No”) BECOMES row.item(“Cheque/Ref No”).tostring

do it for each field you are adding

I have tried above method but again getting an same error message.

Code Modified in AddDataRow- Properties- ArrayRow- “{row.item(“Narration”).ToString,row.Item(“Cheque/Ref No”).ToString,row.Item(“Withdrawal Amt”).ToString,row.Item(“Deposit Amt”).ToString}”.

This AddDataRow activity was included under For Each- If Condition- AddDataRow. Sorry I’m unable to share the screen shot due to AWS Key ID doesn’t exist.

To trouble shoot, just add raw strings for now in the ArrayRow property of your AddDataRow activity. As many as there are columns in your target datatable.

So something like: {“A”,“B”,“C”}

If there is still an error, please check the datatypes of the columns in your target table. Are they string types?

Fine try with this
{row(“Narration”).ToString,row(“Cheque/Ref No”).ToString,row(“Withdrawal Amt”).ToString,row(“Deposit Amt”).ToString}

but make sure that
–row variable is available like we are inside the for each row loop
–then check once that the number of values passed in the array row should match the number of columns in the datatable mentioned in the datatable property of the ADD DATA ROW Activity
–then change the type argument property as String in the property panel of ADD DATA ROW activity and if so make sure that all the columns in the datatable is of type string
because array can take only a single type of datatype in it, so make sure that all the columns in the datatable is of type string
to check that
this will give the datatype of column we specify

cheers @BaskaranVenkatesan

1 Like

Hi, I had tried above two methods but getting the same error. In the build Data table i had selected Particular as string, Cheque/ Ref No as String and Int(tried both), other debit & credit amount as int32 but again getting the same error message. Additionally tried Generic also but till error remians.

1 Like

To test, try and pass raw strings as stated above.

Also, run in debug mode and note the exact variables that are being passed to the column producing the error. Make sure they are as you would expect, i.e. a string being passed to a string column.

is the datatable tto which we are adding the data row is a built one with build datatable activity or obtained one from any excel
if its a build one we can change the suggested type GENERIC VALUE as a column type for thatt column cheque/Ref No
if its a obtained one then before this if condition use a assign activityy like this to change the datatype as generic value
cashBookDT.Columns(“Cheque/Ref No”).Datatype = GetType(uipath.Core.GenericValue)

Cheers @BaskaranVenkatesan

Hi All, Thanks for your support. I had cleared that error manually but facing new error while calculating the Bank Statement Different amount. Please advise.

Can you tell us the fix to the original error? What was causing it and how was it resolved?

For the new error, you are assigning a variable to itself (bankChargesDebit), can I ask why? unless it has already been initialized elsewhere, I believe you will encounter this error.

Hi, Thanks for your reply. In the first error i had modified the build data table columns similar to my bank statement. New error also cleared, i had changed the datatype. Thank you!