Add New Row in REFramework- Process Transaction

Hi,
I’m working on trying to add a new row (currently residing inside Process.xaml) each time process.xaml iterates through a new transactionitem/transactionid. I’ve built the DataTable outside the “loop” and is in the init state (in a xaml file of it’s own). When I do just “Add new row” (passing about 10 variable values into the new row via ‘Array Row’ property), the first row (after headers) is being replaced with data from the most recent transaction run. With ‘Append Range’ being placed right after ‘Add Data Row’, the data is coming out crazy (a lot of duplicates) and I lose the headers somehow.

Can someone help me understand what is the best way to add a row of data (to fill about 10 columns) with the data that is extracted each time the process.xaml is run? Thanks!!

Hi @hellodee ,
Let me see if I’m understanding well, you are passing the datatable to the process.xaml by argument right? If yes, what direction?

DataTable coming out of Init state’s xaml file is in the ‘Out’ direction. In process, it is in/out direction. Initially, I thought I would pull it into end state, so I can read the excel file cleanly, remove duplicate rows, but that didn’t seem to work. Thank you for looking into this!

Hum, can you share the example? Will be more easier to understand what it’s causing trouble

Hey Marcelo, can’t really do screenshots, but i’ll break it down (hopefully this works).

  1. Created a .xaml file i’m invoking into Init State. Inside this file, I have done ‘build datatable’ where i have 10 columns. i’e unselected “unique” for all columns. the datatable output is an argument (dt_outputTable). I have tied this argument with variable (dataTableComparison) in my REFramework. Argument is going “out”
  2. In my process.xaml, I’m doing ‘Add data row’ (one activity in all my process.xaml). My properties are: ArrayRow (passing 10 variables to match my 10 columns), and DataTable is my argument from number 1 (dt_outputTable). This argument is going in/out and tied with the same variable in framework (dataTableComparison).
  3. I have a simple write range activity in my “End Process” state (with AddHeaders selected) and I’m writing all the rows into that file.

I tried this on a simple process/sequence with add data row inside a for each row and the write range activity outside the loop and it worked great. In the framework i’m getting an empty file so not sure where i’m missing it. No errors when i run the framework either

Hi,

Through the information which you had provided, it seems something is going wrong while you are giving directions to Argument.

Somewhere in your workflow it is getting blank DataTable.

Either you can provide us a sample workflow so that i can help you more or just do Debug of your workflow and check the datatable variable at each step.

Let me know in case of any question.

Regards,
Sahil

In my write range i entered the argument value (dt_outputTable). I just changed it to the variable (dataTableComparison) and will see if that works. When datatable is created it is going out, in process it is going in/out, and when it is end state, i don’t have it in a xaml file-- just doing the write range activity after the ‘close applications’ workflow is invoked. Maybe i need to call the variable instead of the argument since it’s not in a workflow of it’s own?

Exactly, it might be possible that in first out direction or in the in/out direction , the argument is getting null and when you try to write value data in excel it is writing nothing.

Just do Debug or Step into and check the datatable variable at each step where it is getting null.

That did the trick!!! I needed to do write range with the variable value that was tying my argument, not the argument itself. AH! I guess you call arguments when they are inside workflows, but outside of them, you need the variable-- which makes sense.

The thing which i means to say that somewhere the variable or argument whatever you are using is getting null value . Just try to check through debugging.

Can you share the workflow, so that i can help you more.

Hey Sahil, it worked. I did write range with the variable instead of argument and it worked.

That’s great , please mark it as solution also and it will also help in ending the topic.

Regards,
Sahil Garg

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.