Lets say I run a process multiple times the sr no. Should continue rather than starting form 1
For eg
1
2
3
4…so on
How should I do it?
Thankyou
Lets say I run a process multiple times the sr no. Should continue rather than starting form 1
For eg
1
2
3
4…so on
How should I do it?
Thankyou
Hello @Bhushan_Nagaonkar, try something along these lines:
1. | Orchestrator Asset: | |
---|---|---|
• | Create an Orchestrator Asset to store the last used serial number. This asset will hold the current value of your serial number. | |
2. | Initialization: | |
• | In the initialization part of your workflow, retrieve the current value of the serial number from the Orchestrator Asset. | |
3. | Increment the Serial Number: | |
• | After retrieving the serial number, increment it by 1 in your workflow. | |
4. | Use the Serial Number: | |
• | Use the incremented serial number as needed in your process. | |
5. | Update the Orchestrator Asset: | |
• | Before the end of your process, update the Orchestrator Asset with the new value of the serial number. This ensures that the next run will continue from the correct value. | |
6. | Error Handling: | |
• | Implement error handling to handle any exceptions or errors that might occur during the process. If an error occurs, make sure not to update the Orchestrator Asset, so the serial number remains unchanged. |
Cheers!
If you are running the process at different time which is creating a different file in which you wanna append the serial number just do the following.
Use an asset to keep a track of counter, and Use Set Asset everytime to increment the value
Thanks
In UiPath, you can easily achieve a scenario where a process continues with an incremented serial number rather than starting from 1 each time. Here’s a basic outline of how you can do it:
Initialize a Counter: Before your main process starts, initialize a counter variable that will hold the serial number. You can use an Assign activity to set an initial value. For example, set counter = 1
.
Use Counter in Your Process: In your main process, wherever you need to use the serial number, use the counter
variable. For example, you might append the value of counter
to a filename, log it, or use it in any way you need within your process.
Increment Counter: After each run of your process, increment the counter
variable by 1. You can do this with another Assign activity like counter = counter + 1
.
Save Counter Value: To ensure that the counter retains its value between runs of your process, you can save it to a file or a database at the end of each run. Use a Write Text File activity or any suitable method to save the current value of counter
.
Load Counter Value: At the beginning of your process, read the saved counter value from the file or database and assign it to the counter
variable to continue from where you left off. Use a Read Text File activity or other relevant methods to retrieve the saved counter value.
Thanks!!
What do you mean serial number? What do you mean “run a process multiple times?” Are you talking about individual Jobs? Multiple items processed within one Job? A loop? You have to give more detail about what you’re doing and what your goal is.
I have a process where I will run it multiple so that process should take the last serial no. In excel and increase one by one.
I have 3 columns so in 3 of those input wil come.
First run:
If do another run
It should add the serial no. Rather than starting from one.
4
5
6
And so on
I’m not using orchestrator in this case.
@adiijaiin and I’m having in a same file
Hi @Nitya1 can you share the process for step 5 thanks
Ohhh, if this is the case,
Just use a read range activity,
assign int rowsPresent= DTData.RowCount
use write cell activity for writing these 3 column values. Or else if you’re creating a DataRow, you can convert it into DataTable by using CopyToDataTable() function and then append range in your excel file.
Note: For the first run there would be zero rows present in that case you can use a write range activity, in the else section you can use Append Range.
Thanks
Thankyou addi jain it helped
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.