OData.Count missing from Orchestrator HTTP request

When attempting to run a simple HTTP request to the orchestrator, the OData count is missing when I run remotely (started from assistant). When running directly from studio this count is present, I have saved both responses:
Ran remotely:

{"@odata.context":"https://cloud.uipath.com/TestOrchName/DefaultTenant/orchestrator_/odata/$metadata#QueueItems","value":

And then when ran locally:

{\"@odata.context\":\"https://cloud.uipath.com/TestOrchName/DefaultTenant/orchestrator_/odata/$metadata#QueueItems\",\"@odata.count\":13842,\"value\":

This used to work remotely but doesn’t anymore, all that’s changed is I have recently updated to Studio 22.4.0

1 Like

Hey @moulton

The remote run was ran by a robot which has access ?

Thanks
#nK

Yes, I have ran this multiple times in the past remotely just fine. This issue has only cropped up today

1 Like

Hey @moulton

You are using orchestrator http activity, is that correct ?

Thanks
#nK

hi @Nithinkrishna

Yes I am

1 Like

Cool, and this is exactly due to the folder issue then ?

So now what’s the endpoint you are trying to call here ?

And did you mention the folder path in the activity?

Thanks
#nK

I don’t think its due to the folder path as, when I run it on my local studio, the process works perfectly fine. It’s as soon as I publish it that the HTTP request returns slightly different responses.
Here’s my request:

String.Format(
"/odata/QueueItems?$filter=QueueDefinitionId eq {0} and CreationTime gt {1} and CreationTime lt {2}",
In_dicQueueNameToQueueID(Queue),
In_arr_dtmReportDateRange(0).ToString("yyyy-MM-ddTHH:mm:ssZ"),
In_arr_dtmReportDateRange(1).ToString("yyyy-MM-ddTHH:mm:ssZ")
)

In a previous step I loop through each queue in a folder and store its name and ID in that dictionary

1 Like

Hey @moulton

You are passing a queue definition id here right, just pass that folder path in which the queue is present in the Orchestrator HTTP activity which will do the trick, Try once please…

Thanks
#nK

Do you mean in the Misc input “Folder Path”? If so that value is populated.
I am still receiving a valid JSON response from this request it’s only the odata count that is missing

1 Like

Hey @moulton

Yes that input prop.

But you are saying the response has queue items but not the count of it ?

Thanks
#nK

1 Like

Hi,

Yes it does have the items, I need to keep track of the number of returned items as its the escape condition in my while loop. As I’m querying a cloud based orchestrator it only returns 1000 items, so having this OData count helps me keep track of how many loops are needed to extract all items.

1 Like

okay got it, just pass in the odata query to return count as mandatory parameter.

$count=true

Thanks
#nK

3 Likes

Okay, I’ll give this a run and let you know

/odata/QueueItems?$count=true&$filter=QueueDefinitionId eq {0} and CreationTime gt {1} and 

This has worked, thank you very much @Nithinkrishna

1 Like

Cool buddy :+1::innocent: @moulton

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