Filter for Nested Values in Orchestrator API Calls

Hello,

I am attempting to create a filter for an OData call to the odata/Machines endpoint. I need to be able to filter by RobotUsers → RobotId to return a single result as I would like to avoid having to iterate through the results on the client side. The only documentation I have found states that in order to access the property of a property, the proper formatting is to use / in between each property. The below data is the sample output structure that I am working with in the Swagger: {
“value”: [
{
“LicenseKey”: “string”,
“Name”: “string”,
“Description”: “string”,
“Type”: “Standard”,
“Scope”: “Default”,
“NonProductionSlots”: 0,
“UnattendedSlots”: 0,
“HeadlessSlots”: 0,
“TestAutomationSlots”: 0,
“AutomationCloudSlots”: 0,
“AutomationCloudTestAutomationSlots”: 0,
“Key”: “3fa85f64-5717-4562-b3fc-2c963f66afa6”,
“EndpointDetectionStatus”: “NotAvailable”,
“RobotVersions”: [
{
“Count”: 0,
“Version”: “string”,
“MachineId”: 0
}
],
“RobotUsers”: [
{
“UserName”: “string”,
“RobotId”: 0,
“HasTriggers”: true
}
],
“AutomationType”: “Any”,
“TargetFramework”: “Any”,
“UpdatePolicy”: {
“Type”: “None”,
“SpecificVersion”: “string”
},
“ClientSecret”: “string”,
“Tags”: [
{
“Name”: “string”,
“DisplayName”: “string”,
“Value”: “string”,
“DisplayValue”: “string”
}
],
“MaintenanceWindow”: {
“enabled”: true,
“jobStopStrategy”: “None”,
“cronExpression”: “string”,
“timezoneId”: “string”,
“duration”: 0,
“nextExecutionTime”: “2024-12-19T19:17:25.434Z”
},
“VpnSettings”: {
“cidr”: “string”
},
“Id”: 0,
“UpdateInfo”: {
“updateStatus”: “None”,
“reason”: “NonCompliantWithDifferentVersion”,
“targetUpdateVersion”: “string”,
“isCommunity”: true,
“statusInfo”: “string”
}
}
]
}

If I were to follow the formatting in the documentation, it would appear that the correct filter to access the RobotId would be as follows: RobotUsers/RobotId eq ‘##’, but when I try this in the Swagger, I get a 1000 error. I have also tried RobotUsers/any(u: u/RobotId eq ##) and received the same error.

Can anyone please assist me in setting up this filter in the correct format needed to access the nested values?

Additional information:
Version of Studio: 2023.10.8 Standalone
Activity Used: HTTP Request (do not want to use the Orchestrator Request activity)
Project Type: Windows-Legacy

keep in mind, that RobotUsers is a navigation property and maybe an expand is helpfully.

should work, as the filter will point into an array of RobotUserDto

We suggest to do the RnD first in Swagger. Also the Orchestrator / Definition plays a role
grafik as there is a relationship to the OData Version

also have a look here:

grafik
Link: OData Version 4.0. Part 1: Protocol Plus Errata 03

And (Url / $filter)
http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html

Thanks for the reply! I have been doing my research and development in Swagger before building it out in my automation, but I added the information about the activities that I plan to use in case there were any questions about the process itself.

I tried to add RobotUsers as an expand and recieved this error.

I’ve tried that filter and it doesn’t work by itself or even when combined with the RobotUsers expand like you suggested.


Also, our Orchestrator / Definition only allows us to select V17.0. Could this be why the filter doesn’t work?
image

as mentioned we worked on V18.

Sometimes it helps to explore different statements on close related other Endpoints e.g.
/odata/Machines/UiPath.Server.Configuration.OData.GetAssignedMachines(folderId={folderId})

in the past we encountered some that some Odata URL parts were not working as expected. But we can exclude any bug from our side within the syntax. So also try approach with alternates and explore as more

As a last resort: Get in touch with the UiPath support, if you have an Enterprise license key

I have been able to identify a work around using that endpoint and a stop function because it returns more than just one object even with the RobotId set correctly.

I’ve built processes in the past that pull a larger object, then deserializes the response and iterates through the Jobject, but ultimately I would like to understand how to access those nested properties correctly in the filter to avoid having to go that route every time I need to access data in a nested property. I even found this tutorial in another forum post that explains how to do this in a way that I can mostly understand, but I’ve attempted to use several versions of the syntax outlined in the tutorial with my use case and I’m still receiving the same 1000 error.

Is there any UiPath documentation that outlines what type of data is returned in the call? EDIT: I’m going to assume that what I’m trying to accomplish is based on complex type syntax after reading through this thread again and it would appear that this syntax still does not work for V17 and OData 4.0. I will try reaching out to my enterprise support

@DroidDev,

Just to make sure, check if you have the “Strict API” checked. If yes, then uncheck it and try again.

It’s a new setting that UiPath implemented, and it comes checked by default for new tenants.


Unfortunately I don’t believe we have access to those settings. From the documentation I’ve found, that appears to be an option only for cloud based users - we are usinging the standalone, on premises version 2023.10.8. Additionally, it appears that the strict API fields are limited to the Queue Items entity and should not impact a query to the Machines endpoint and filtering based on the RobotUsersDto.

Reached out to my enterprise support contacts and have yet to recieve a response. Replies to this thread have yielded no solutions thusfar. ATP, I am going to assume that filtering by nested properties is still not possible, even 4 years later, within the Orchestrator API model. Good luck to anyone else who might be trying to find a solution to a use case similar to mine.