Add status column RPAChallenge - REFramework

Hi guys! I’m doing the rpa challenge with REFramework, and I want to add a status column to the excel file, so when it’s successful it adds an ok statement. My problem it’s that I don’t know how to reach the cell. I created an external sequence, and I import TransactionItem(DataRow).

Hi @Lautaro_Ezequiel_Ledesma

I guess you are working with REFrameWork,
In the initialization state itself once you’ve read the Data from Excel,
Use an Add Data Column Activity. Give Column Name: Status and DataTable in which your records exist.

Now whenever you’re done processing, either in the process block at the end or in the set transaction status you can use:

assign

TransactionData(in_transactionNumber)(“Status”)= “OK”

1 Like

Thanks for replying!
I tried to do what you said, or what I understood


It throws me this error

@Lautaro_Ezequiel_Ledesma

In the Locals/Variables panel to the left, check the values of Config("Ok") and dtTransacrionData if they are available

Thanks

1 Like

@Lautaro_Ezequiel_Ledesma

As per error one of the variable used in assign activity is null… mostly it is dt I believe as I can see values for transaction number and config…also transaction number starts from 1 and the row index in excel starts from 0…so mat be we need to use in_Transactionnumber-1

cheers

1 Like

hi @Lautaro_Ezequiel_Ledesma

Did you create a Key value pair with OK in the Config file?
That could be the case,

Also right after reading the transactions in your dt_TransactionData, did you use an add data column activity to add the Status Column, Can you try to check it in Debug mode in the Locals panel, whether you’re able to see that column in your dt_TransactionData.

1 Like

Yes I did, i forgot to mention that the error apears when finishes the upload in the browser. I think that the error could be that, when the whole transaction finishes, counts as a succes transation, and tries to assign the succes value to a table that no longer exists. If that could be the case, I should try creating an if where I check the existance of the dt_TransactionData table?

Update: It was that, so I made an if that controls that the number of transactions is not longer than the number of rows in the excel table.
But I think that the assign is not writting in the excel file, how can I do that?
Thanks!

Once you have completed all the transactions, in the end state, you can write this datatable back to Excel.

By assign the value we have added that to the DataTable. Now this DataTable needs to be written back into Excel.
And hence you’ll be able to see the data.

1 Like

That makes a lot of sense, how do I that?

Use a Write Range Activity in the End State. and Write this DataTable that you have been modifying.

1 Like

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