Consecutive numbers to a web form

Hi I am new to RPA, i need to fill a web form with a unique number each time i fill it. the number has 2 parts current year and a consecutive number, +1 each time.

Maintain a variable and increment each time you loop.

Regards,
Karthik Byggari

1 Like

Hi
Welcome to UiPath community
We can use any loop like while or For each loop
Let’s take like while loop and out the condition like this
Counter < 10
Where Counter is a variable of type int32 with a default value defined as 0 in the variable panel

Now inside the loop use a use your value

Like this
Now.Year.ToString+”_”+Counter.ToString

And atlast in the while loop use a assign activity to increment that value like this
Counter = Counter +1

Hope this would help you
Cheers @sanjeevSB

thanks

1 Like

Cheers @sanjeevSB

i ran this but it gives same number each time

you were almost done
keep the message box inside the while loop and try once
make sure that the Unique_Id is with value
Now.Year.ToString+“_”+counter.ToString

Cheers @sanjeevSB

thanks a lot, its working, now i hope if i assign this value to a type activity in a sequence, each time it will pick a new value.

1 Like

yah
you did it… :relaxed:
Cheers @sanjeevSB

thanks,

it gives different values in message box, but when i assign it to fill a form it gives same value each time. please help.

@sanjeevSB

The activities you used to enter details into the form also should be inside the loop but not outside.

Thanks, that was the mistake.

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