Record variable to excel spreadsheet

Hi,

I have a csv file where i have loan numbers to run the bot, where the bot fails to run the process i need the bot to create a new excel spreadsheet an store the loan number in column A and status as failed in column B.
The bot should then pic up the next loan number an run the process until no more loan numbers are in the file.

can anyone help me?

Hi
hope these steps would help you resolve this
–use a bUILD DATATABLE ACTIVITY and create two columns named Loannumber and status both columns of type string and get the output with a variable of type datatable named finaldt
–now use READ CSV FILE activity and get the output with a variable of type datatable named dt
–then use FOR EACH ROW activity and pass the variable dt as input
–inside the loop use TRY CATCH activity and place the sequence of activities to be performed
and if any activity fails it will go to CATCH block where we can use a ADD DATAROW activity and mention the input as {row(“loannumber-columnname”).ToString,“Failed”} in ArrayRow property and in the dattable property mention as Finaldt

–this will add to the datatable Finaldt the faulted one which can be written to excel with WRITE RANGE activity

@nick.v

Hi,
I have been building what you have said however i am getting this error, please see below

image

Kindly mention your columnname from the excel that you have not this loannumber-columnname

@nick.v

i don’t follow what do you mean? what i want the column to say?

Fine can i have a view on the CSV file a screenshot if possible
@nick.v

yeah sure, please see below,

image

is this the input csv file @nick.v

Yes it is

then mention the input in ArrayRow property as
{row(“Loan Number”).ToString,“Failed”}

kindly type from your side in studio as when we copy- paste from here double quotes direction will change
@nick.v

its says row is not declared

currently i have my workflow set up like this

is this how it should look?

@Palaniyappan

1 Like

you were almost done
place that ADD DATAROW within that FOR EACH ROW activity
@nick.v

haha thanks however its being a pain, its now saying

image

@Palaniyappan

not able to see the image
@nick.v

basically it is saying 'Catch or Finally expected for TryCatch activity ‘Try Catch’. not sure what to do here

@Palaniyappan

image

yah in catch block include a exception type like this
System.Exception
make sure that you have kep this add datarow activity inside the this catch block
@nick.v

am not too sure what you mean i have clicked on the System.Exception but not sure where you’d like me to add the dataraw activity. I have attached the file for your convenience.

Record fail loop.xaml (7.8 KB)

1 Like

Hi @Palaniyappan also where in my main process should i enter this sequence for it to work?