I am using excel activity to export logs in excel but even using auto increment row still it still not putting in same cell

I’d like to track whenever a robot completes its flow, we should record the step number in an Excel sheet. In the adjacent cell, we can mark it as “Passed” if the flow finishes successfully. If the flow fails at any point, we should record the step number where it stopped and label the next cell as “Failed.” How to do this ?

Hi @sandeep.pund

Can you please share some screenshots on how you have configured the flow in UiPath studio?

This will help us understand better to help you better.

@sandeep.pund Try this logic

Read excel
for each Loop data table

try

//Passed
write cell Success (“B”+int_StatusCounter.ToString)
int_StatusCounter = int_StatusCounter+1

Catch
//Failed
write cell Failed (“B”+int_StatusCounter.ToString)
int_StatusCounter = int_StatusCounter+1

Hi @sandeep.pund

You can either use the For Each Excel Row activity, or read the Excel file into a DataTable variable and loop through that variable. Within the loop, apply an If condition to handle both the success and failed scenarios and within the then and else block place the write cell activity.

Ensure that the Auto Increment checkbox is enabled in the Write Cell activity. If the row count starts from 2, specify the cell reference in the Where to Write field as:
Excel.Sheet(“SheetName”).Cell(“B2”).

Regards,
vrdabberu

i have create data table where i have two columns.


after that i have used add data row for whenever i run this flow automation will create Unique item id.

and i have used use excel file

can you please assist me on this bcz am stuck

Hi @vrdabberu i have tried with for each excel row but its not working


can you take a look and assist me on this ?

Hi @sandeep.pund

Can you please share the error message?

Regards
vrdabberu