Need help in loop

Hi All,
I need 2 loops
Outer loop will run indefinitely (will use while loop n set condition always true)
Inner loops should run for 24 hours and exactly at 12 am should exit fetch some change data from outer loop and again run for 24 hours…n so on
Please tell me how to make this inner loop run?

In the outer Loop:

While
    Condition is True{
    //Inner Loop
          While
                 Condition is **not System.DateTime.Now.ToShortTimeString = "00:00"**{
                  <Do Task>
          }
          <Do Task>
}

Change the “00:00” as per your system time. The following should work as per your requirement

@ayush_purohit its working only problem if i set it to 00:00 it wil exit twice…12 am n 12 pm…i need only 12 am

In this case you can just convert the time into 24 hr format.

  • ToShortTimeString(“h:mm:ss tt”) = Converts the Current Date and Time to 12 hours format
  • ToShortTimeString(“HH:mm:ss tt”) = Converts the string to 24 hours format

If the solution works, can you please mark it as the ans. If you are still facing the problem, let me know.

Hi @Ashwin_Swain

I think running a robot 24/7 is not a good idea unless there’s no other way. Instead I suggest you to publish your package in orchestrator and create a schedule/trigger to perform your task in regular intervals.

Can you tell me what kind of task you are planning to automate? I’ll try to suggest the exact process

1 Like

Hi @Surya_Narayana_Korivipadu
I am preparing a bot which can automatically assign tickets to certain individuals based on the roster provided on excel.
As of now m stuck with the bot not extracting data from Assignee text box(i guess some selector issue)
But then yesterday my manager told we would implement iris interface for which permission are being taken so the bot should be made keeping that in mind.
The database which i have unfortunately doesn’t have assignee column so with iris we will get that data from iris api so i guess 24/7 the bot has to run.
Earlier this bot was made using python automation which i feel is better suited for 24/7 as its scripting language.

I’m not aware of Iris. But if Iris application has a functionality to trigger API requests, then it’s good to trigger your UiPath process from Iris via UiPath API. This can be done whenever there’s data in iris. This way you don’t need to consume robot’s time 24/7

For example, in our project our automation process is triggered by Servicenow, whenever there’s a relevant ticket in ServiceNow. A script is written in ServiceNow to do so.

Nice @Surya_Narayana_Korivipadu

1 Like

Did it help you?