Hi,
I’m trying to query assets from the Orchestrator, using the $filter
option to look for assets with a specific name. However, I can’t manage to get $filter
to return an exact match using the eq
expression.
The problem occurs when I have assets, where the name of one asset is a substring in the name of the other asset.
For example, I created an asset called foo
, and an asset called buffoon
. When I query the asset named buffoon
, exactly that asset returned, as expected:
GET https://platform.uipath.com/odata/Assets?$filter=Name%20eq%20'buffoon'
{
"@odata.context": "https://platform.uipath.com/odata/$metadata#Assets",
"@odata.count": 1,
"value": [
{
"Name": "buffoon",
"CanBeDeleted": true,
"ValueScope": "Global",
"ValueType": "Text",
"Value": "eleven",
"StringValue": "eleven",
"BoolValue": false,
"IntValue": 0,
"CredentialUsername": "",
"CredentialPassword": "",
"Id": 19900,
"KeyValueList": []
}
]
}
However, when I query for foo
, both assets are returned, even though I use eq
meaning that the Name should exacly match ‘foo’:
GET https://platform.uipath.com/odata/Assets?$filter=Name%20eq%20'foo'
{
"@odata.context": "https://platform.uipath.com/odata/$metadata#Assets",
"@odata.count": 2,
"value": [
{
"Name": "foo",
"CanBeDeleted": true,
"ValueScope": "Global",
"ValueType": "Text",
"Value": "one",
"StringValue": "one",
"BoolValue": false,
"IntValue": 0,
"CredentialUsername": "",
"CredentialPassword": "",
"Id": 19899,
"KeyValueList": []
},
{
"Name": "buffoon",
"CanBeDeleted": true,
"ValueScope": "Global",
"ValueType": "Text",
"Value": "eleven",
"StringValue": "eleven",
"BoolValue": false,
"IntValue": 0,
"CredentialUsername": "",
"CredentialPassword": "",
"Id": 19900,
"KeyValueList": []
}
]
}
The same happens, even when I use other filter expressions that should for sure give me only the one I’m looking for, for example endswith(Name, 'foo')
.
GET https://platform.uipath.com/odata/Assets?$filter=endswith(Name%2C%20'foo')
It looks to me like UiPath Orchestrator is changing all OData $filter
expressions to substringof
OData $filter
expressions,
Has anyone encountered the same, and found a solution?
Kind regards,
Peter.