I am using a get job activity, and I am using a use Expression in a filter. I want to get jobs from the last 43 days to today’s date using the expression
"StartTime gt " + Now.AddDays(-42).ToString(“yyyy-MM-ddTHH:mm:ss.fffZ”) +
" and StartTime lt " + Now.ToString(“yyyy-MM-ddTHH:mm:ss.fffZ”)
Its just give me a 43-day job, are there any restrictions to get only 100 jobs or 1-day jobs? want a solution that gives me a job from the past 43 days to today’s date
get Jobs returns max 100 per call, so use paging.
Filter example:
StartTime gt " + Now.AddDays(-43).ToString(“yyyy-MM-ddTHH:mm:ss.fffZ”) +
" and StartTime lt " + Now.ToString(“yyyy-MM-ddTHH:mm:ss.fffZ”)
Set Top=100 and increase Skip (0,100,200…) until no more results.
Get Jobs activity returns a maximum of 100 records per request due to OData pagination limits. Since you are trying to retrieve jobs for a larger date range (for example, the last 43 days), you will only receive the first 100 records unless you implement pagination logic.
To fetch all jobs, you must use the Top and Skip properties inside a loop. Initialize a master list to store all jobs, call Get Jobs with Top = 100 and increment Skip by 100 after each iteration, then append the returned batch to your total list.
First Initialize :
varTotalReturned = New List(Of Job)
* Then Use a **Do While** loop:
* Inside the loop, use **Get Jobs**
* Set **Skip = varTotalReturned.Count**
* Store result in `varReturned`
* Append results: