naveen.s
(Naveen S)
December 11, 2024, 10:51am
1
Hello all,
How to store the time in minutes in asset in UiPath??
For example: I want to store the asset value as 5 minutes for time 10 minutes for some cases and 20 minutes for some cases ,so I dont wanna change the code again and again, so I need to configure in asset, please help on this.
Shakib
(Shakib)
December 11, 2024, 10:52am
2
To store time values in minutes as assets in UiPath and use them dynamically in your workflows, follow these steps:
1. Create the Asset in Orchestrator
Navigate to your UiPath Orchestrator.
Go to Assets and create an asset (e.g., ProcessingTime
).
Set the value as the desired time in minutes (e.g., 5
, 10
, or 20
).
2. Retrieve the Asset in Your Workflow
Use the Get Asset or Get Orchestrator Asset activity in your workflow to retrieve the asset value.
Specify the asset name you created in Orchestrator.
Store the retrieved value in a variable, e.g., processingTimeString
.
3. Convert the Asset Value to an Integer
4. Use the Value Dynamically
Use processingTime
wherever needed in your workflow. For example, if you need to wait for the specified time:
Example Workflow:
Get Asset → Retrieve ProcessingTime
.
Assign → Convert string to integer (processingTime = CInt(processingTimeString)
).
Delay → Use TimeSpan.FromMinutes(processingTime)
.
Advantages:
Centralized configuration in Orchestrator eliminates the need to modify code repeatedly.
You can adjust the time values on the fly by updating the asset value in Orchestrator.
If you’d like a sample workflow for this, let me know!
naveen.s
(Naveen S)
December 11, 2024, 10:55am
3
In delay activity, how to mention that minutes??
Shakib
(Shakib)
December 11, 2024, 10:57am
4
In the Delay activity in UiPath, you need to provide a TimeSpan
object to specify the delay duration. To use minutes dynamically, follow these steps:
Steps to Configure Delay with Minutes
Create or Retrieve the Time in Minutes
If you already have the minutes stored in an integer variable (e.g., processingTime
), you can proceed.
Use the TimeSpan
in Delay
In the Delay activity’s Duration
property, use the following expression:
TimeSpan.FromMinutes(processingTime)
Here:
processingTime
is the integer variable containing the number of minutes you retrieved from the asset.
Example:
If processingTime
is 5
, the Delay activity will pause for 5 minutes.
Complete Example for Dynamic Delay
Retrieve Asset
Use the Get Asset activity to fetch the asset value (e.g., 5
minutes) and store it in a string variable, processingTimeString
.
Convert to Integer
Use an Assign activity:
processingTime = CInt(processingTimeString)
Configure Delay
Add a Delay activity and set the Duration
property to:
TimeSpan.FromMinutes(processingTime)
This approach makes the delay duration completely dynamic and configurable from Orchestrator.