Reading 2 csv files to compare and find differences then writing to csv file

Struggling with this workflow as it keeps throwing different errors:

  1. Column not found

  2. then Assign date does not evaluate to a Boolean term

  3. Thought I resolved the column issue but it keeps coming back then

  4. not finding an understandable solution to the Boolean term issue

Can you please help resolve my workflow?
Studio.zip (187.7 KB)

I did not check the whole process. This is jus the first bug I found.

  • In “Generate: dt_Collections” ADHOC column was autodetected as Boolean data type
    image

  • however in “Filter: Non-Accounting” you treat it as String data type
    image

  • correct condition
    image

I did not check for other bugs.
I propose to use UiPath powerfull debug functionality to fix your process.

Cheers

Thanks @J0ska. I have made the corrections.

I have checked for a space after the column name but still I am getting this exception. How do I resolve it:

“Id”: “1.167”,
“InstanceId”: “15”,
“Name”: “Assign: Collection Control Key - Financials”,
“TypeName”: “System.Activities.Statements.Assign”

RemoteException wrapping System.Data.EvaluateException: Cannot find column [COLLECTION_CONTROL_KEY57578254].
at System.Data.NameNode.Bind(DataTable table,
List1 list) at System.Data.DataExpression.Bind(DataTable table) at System.Data.Select..ctor(DataTable table, String filterExpression, String sort, DataViewRowState recordStates) at System.Data.DataTable.Select(String filterExpression) at Namespace_6041.Main_Expressions.Main_Expressions_TypedDataContext4_ForReadOnly.__Expr18Get() at Namespace_6041.Main_Expressions.Main_Expressions_TypedDataContext4_ForReadOnly.ValueType___Expr18Get() at Namespace_6041.Main_Expressions.InvokeExpression(Int32 expressionId, IList1 locations,
ActivityContext activityContext)
at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context) at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity)
at System.Activities.InArgument1.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance activityInstance, ActivityExecutor executor) at System.Activities.ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument, Int32 nextArgumentIndex, ActivityExecutor executor, IDictionary2 argumentValueOverrides,
Location resultLocation,
Boolean isDynamicUpdate)
at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor,
IDictionary`2 argumentValueOverrides,
Location resultLocation,
Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)

Use debug mode and verify expression where the exception occures.

Cheers

@J0ska, I’m still learning how to work with debug. I am struggling to figure out how to fix the issue and would really appreciate some guidance in order for me to learn and move forward.

Learning by doing. It is the best method.

I will give you a hint: You have it all in the error message.

“Id”: “1.167”,
“InstanceId”: “15”,
“Name”: “Assign: Collection Control Key - Financials”,
“TypeName”: “System.Activities.Statements.Assign”

RemoteException wrapping System.Data.EvaluateException: Cannot find column [COLLECTION_CONTROL_KEY57578254].

It states Cannot find column [COLLECTION_CONTROL_KEY

  1. Don’t know why it is referencing the 57578254 specifically as it is one of the rows
  2. Both my datatables extracted from the csv files has the column, without spaces

I honestly dont know

The error states

and the error statement is correct. Thus search why column name is not what you expect…

image

Sorry, do not undertand the point.

EDIT: Bingo! Almost there. Correct syntax:

dt_Financials.Select("[COLLECTION_CONTROL_KEY] = '"+ strCollCntrlKey + "'")

Okay so have fixed all of the problems only to get the below error:

Fixed the above: dt_Financials.Select(“[EFFECTIVE_TRANSACTION_DATE_KEY] = '”+ strEffTranDateKey + “'”)

1 Like

Now getting: Assign: Data from Date - Financials: Cannot perform ‘=’ operation on System.Int32 and System.String.

It is just peanot for you. Check that both sides of the expression use the same data type.

Note: Not all what looks like a date value is in fact a date value.

When generating the datatable from the CSV, both the Collections and Financial … Date columns read as System.Int32
For Collections:

For Financials:

The datatable for the exceptions:

My variables:

That’s the point! You are learninig how to debug :slight_smile: