Introduce unique counter- Excel

Hello All,

I have built the following workflow :

  1. Open a folder
  2. look for .xls or .xlsx files
    3)Read a set range
    4)Write into the same xls another sheet
    5)Introduce a unique number (increment counter+ timestamp) to the newly written rows

I am facing a problem where the unique number is repeating for the different files example
Unique ID - starts with 10000 and appended with date (0511) and the increment works on the first 5 digits
File 1 :

File 2:

Actually I need File 2 to be populated like below:

Please find below the Uipath workflow :

It could happen if you are writing to different files inside the Same counter?

tip: MMhhmmss can make it more unique than MMhh - you don’t have to use this if its a requirement

Where would you advice I include the counter.

I can’t point out based on screenshots, can you share xaml.

Test Bench.xaml (38.7 KB)

bring your CounterID out of Foreach files, it will start from 100000 for every file. If you want the number where it stopped from last time, assign counterid before Foreach File in Files.

1 Like

@vvaidya If I bring the counter ID before the for each row it does not do a counter, it applied the same number to each row.

Share the screenshot where your counterid is placed. for each file

Check my screenshot, only CounterID not the increments to before For Each File

1 Like