Jobs Status as Complete

I have multiple instances of a specific process, and I need to count how many of these jobs have been marked as completed/done . Can you help me with the filter criteria I should use ?

Hi @adityaiyer ,

we can achieve this using the “Get Jobs” activity in UiPath.

“ProcessName eq ‘ProcessName’ and State eq ‘Completed’”

use output varaible of same activity

completedJobsCount = jobsList.count

Regards
Sandy

Hi @adityaiyer

// Initialize completed job count
 completedJobCount = 0

// Step 1: Get Jobs
GetJobs jobsOutput

// Step 2: Iterate through jobs
For Each job In jobsOutput
    // Step 3: Check job status
    If job.State.ToString().Equals("Successful")
        // Step 4: Increment counter
        completedJobCount = completedJobCount + 1
    End If
End For Each

// Step 5: Output the count of completed jobs
Log Message "Number of completed jobs: " + completedJobCount.ToString()

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