How to get Queues data as report

Hi Everyone,

I have a scenario and i struck in some part I’m unable to get it. I want to get my queues data as report.

Endpoint: /odata/QueueItems

I tried above code it is giving entire queues data

I want only perticular data like i need to specify my Orchestrator Folder and Queue name and the perticular date. How we get this. I have tried few but nothing is working. Can anyone help me with the right filter condition.

Below are the which i have tried but not working

/odata/QueueItems?$filter=QueueDefinition/Name eq ‘Queue_name’

Assign activity:
FormattedDateTime = DateTime.now.ToString(“yyyy-MM-ddTHH:mm:ss”)

Orchestrator API activity:
Api endpoint= “/odata/QueueItems?$filter=EndTime ge '” + FormattedDateTime + “’ and EndTime lt '” + FormattedDateTime + “'&$orderby=EndTime desc”

Hi @Rreddy

Please check the below thread:

Regards

Hi @Rreddy

Try this and replace dates:

/odata/QueueItems?$filter=QueueDefinition/Name eq 'YourQueueName' and EndTime ge DateTime'2024-02-01T00:00:00' and EndTime lt DateTime'2024-02-02T00:00:00'&$orderby=EndTime desc

If you want to pass the datetime string variable then try this:

/odata/QueueItems?$filter=QueueDefinition/Name eq 'YourQueueName' and EndTime ge DateTime'" + FilterStartDate + "'&$orderby=EndTime desc

@Rreddy

Assign activity:
FormattedDateTime = DateTime.Now.ToString(“yyyy-MM-ddTHH:mm:ss.fffZ”)

Orchestrator API activity:
Api endpoint = “/odata/QueueItems?$filter=QueueDefinition/Name eq ‘YourQueueName’ and EndTime ge DateTime’” + FormattedDateTime + “'&$orderby=EndTime desc”

@Rreddy

check the above thread

Hi @supriya117 I’m getting below error when i try to pass date

@Rreddy

Uri.EscapeDataString("/odata/QueueItems?$filter=QueueDefinition/Name eq 'YourQueueName' and EndTime ge DateTime'" + FilterStartDate + "'&$orderby=EndTime desc")

Make sure that FilterStartDate is in a format that is recognized by the DateTime function in the OData query. For example: “yyyy-MM-dd HH:mm:ss”

Hi @rlgandu for this also I’m getting same error. Invalid odata query.

@supriya117 let me cross check all once again.

@supriya117

DateTime.now.ToString(“yyyy-MM-ddTHH:mm:ss”)

Is this format correct

@Rreddy

Yes, that’s a correct format.

If you are having UiPath Cloud Orchestrator, try to go to your Tenant → Settings → General → disable the Strict API → try to see if the filter work

Strict API → If enabled, certain API fields become non-filterable and/or non-sortable, thus helping prevent performance issues. You can see a list of these fields in the dedicated page.

This setting is enabled by default for new tenants, but existing tenants need to be opted in manually.

Keeping this option enabled at all times is a recommended best practice in API integrations.

@supriya117 can you check this once is this correct


Hi @marian.platonov i don’t have any strict API option there. I’m using my client Orchestrator. It’s not my personal.

@Rreddy

Include Uri.EscapeDataString

This method is particularly useful when you are constructing URLs dynamically and want to ensure that the data you include in the URL is properly encoded to adhere to URI specifications.

Uri.EscapeDataString("/odata/QueueItems?$filter=QueueDefinition/Name eq 'YourQueueName' and EndTime ge DateTime'" + FilterStartDate + "'&$orderby=EndTime desc")

@supriya117 tried including URI also getting status code 400 and error is same

@supriya117 if you have tried in your machine and it’s working for you means. Can you share me the Xaml once. It will be helpful.

  • First check that request in Postman. It may be that the fields are incorrect, or the Dates are not in the correct format, or indeed some fields are not filterable.
  • Check if the GET URL is the same in Studio as in Postman. It may be that some spaces or quotes are incorrect.

@Rreddy

Sequence.xaml (13.2 KB)

@supriya117 I’m getting like this is this correct but the status code is 200