Further information on API exact match using Odata (Orchestrator API)

Hi,

Regarding the post API filter - Trying to get exact match - #3 by Prutsert

I have the same question, however I would like to know where it is stated that some endpoints do not support OData and therefore filter. @ovi, given you replied to the original post, are you able to elaborate please? From what I can see in the documentation and even the endpoint name “odata/Assets” the filter function should be supported?

My current use case is to filter for a specific asset by name: Name eq ‘ABC’

The current results returns more like a “contains” rather than and exact match.

Hi @AWoz, I tried to replicate this error. I have mutiple assets with very similar strings as the asset name to be filtered. However, I get the response of an exact match i.e., only one count in response.value

Tested on UiPath API 20.04 using Postman - Get Request with valid Bearer $token.

https://*onpremorchestrator*.com/odata/Assets?$filter=Name eq 'Test_P01_Path'

May be the earlier versions of API did not support this. The linked post is quite old now (2018) and probably used an earlier API version.

Hi @jeevith,

Did your Orchestrator have two assets with similar names like this?

  1. Test_P01_Path
  2. Test_P01_Paths

In my current case,
$filter=Name eq ‘1’ would return both of the above examples and they both contain a 1.

I am running this on 2019.10.4 so it is getting quite old. I’ll try and test it in 2020.4 and see. Good point :slight_smile:

You have a good point there @AWoz
I extended my strings rather than having different ending letters as you suggested.

Inital test data:

  1. Test_P01_Path
  2. Test_P01_Location

Result:
Reponse.value returns 1 value.

Test 2 data:

  1. Test_P01_Path
  2. Test_P01_Paths

Result:
Now the API returns 2 counts! I also tried with all lowercase and all uppercases for the strings as well. I does return multiples values for all cases.

So you are right to suspect that this filter query is returning a "contains" result rather than en "eq" result.

Not sure if this is a bug or a feature :smiley:

@ovi this issue still seems to be persistent. Could you check this with the devs?