Automation while a core activity is true

Can someone please help me by telling me how to do the following:

I am doing an automation and there I need that as long as a main activity is true, there I have a list of people: Pedro, Paco, Pablo and Paula and that every time that activity is true or that activity happens a task is sent to Pedro, then to Paco, then to Pablo and then to Paula and so on until the main activity is false

@Melanny_Herrera_Cruz

So when you say a activity is true i think you mean some control is present then do this else dont

If so follow the below

  1. Do while activity with condition as true and for safety set a max iteration value as high as you want
  2. Inside it use check app state to check for the control
  3. On then then side send your emails and on else side use a break activity
  4. Also if you need some delay in between consecutive checks before check app state you can add a delay activity

Heers

Can you please show me with an example in UiPath, please.

@Melanny_Herrera_Cruz

I have given the same activity names above please try

cheers

Hi
Define a boolean variable: Create a boolean variable named mainActivity to represent whether the main activity is active. Initialize it to true.

Create a list of names: Create a list of names containing the names of the people: Pedro, Paco, Pablo, and Paula.

Implement a loop: Use a while loop to continue assigning tasks while the mainActivity variable is true. Inside the loop, follow these steps:

Get the next person: Use a counter or an index to keep track of the next person in the list.

Assign the task: Assign the task to the current person from the list. You can do this by displaying a message or performing an action related to the task.

Update the counter or index: Increment the counter or index to move to the next person in the list.

Check the main activity status: After assigning the task, check the mainActivity variable again. If it’s false, the loop will terminate.