Use Two excel files in REFramework

Hi ,

I have 2 excel files, i need :

  • Read the first excel then save column data in list
  • Read the second excel then save column data in list
  • Then compare excel 1 data with excel 2 data.
  • After that compare excel 2 data with excel 1 data.

if it is possible to use REFramework ?

@Teaf

You can use this Re-framework for the Excel files

Hope this will help you

Thanks

Hi @Teaf ,

Depending on your requirements, you can build that logic in the “Process” and in order to only run it once, you can change the following condition:

Workflow: GetTransactionData.xaml

  • out_TransactionItem isNot Nothing Change to in_TransactionNumber = 1
  • This will allow the bot to enter the process only once.

Then inside the process, you can perform the comparisons. On the post below, you’ll find 2 LINQ Queries to compare DataTables, that would suit your needs

  • You might need to modify them a bit due to different requirements

Hope it helps!

Hello!
I know the topic is quite old, however I would like to ask something about it.
What the Init State will look like in this situation? And in Get Transaction Data we must put the Read Range activity?

Hey @zhasmina.dimitrova, had to recheck everything since I did not remember about this post!

The goal of the case is to compare 2 excels, and return the result

We have multiple options with a single transaction (condition in GetTransactionData would be: in_Transactionitem = 1 so it only runs 1 loop):

  1. On the init stage, we read the 2 excels as Datatable (InitAllApplications) → This would mean that we would have 2 out_arguments on the InitAllApplications workflow, each one containing one excel as DT. that would need to be sent to the process. Then on the process.xaml, you introduce that 2 DT’s, and compare the values with the LINQ.

  2. Exactly the same as before, but reading the excels on the “First Run” sequence → that way in case of a SystemException in the process, the excels would not be re-read on each retry.

  3. Send the excel paths stored in Config to the inside of the process, read them inside the Process, and then compare them with LINQ.

Another solution would be to get the excels data inside the init State, check if both excels have the same rows, and use a normal DataRow ReFramework iterating any of the excels. Inside the process then you would make the comparison with the not-chosen excel.

Both solutions would work, depending on the requirements of the process I’d choose one or another.

Hope this solves your question!

BR,
Ignasi

1 Like

@ignasi.peiris Thank you very much so the fast and detailed reply!
I believe this solves my problems and definitely the project structure become more clear to me!
:slight_smile:

1 Like