Introduce unique counter- Excel

excel
activities

#1

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 :


#2

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


#3

Where would you advice I include the counter.


#4

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


#5

Test Bench.xaml (38.7 KB)


#6

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.


#7

@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.


#8

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


#9


#10

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