Skip to main content
Solved

Filter based on a single Attribute value (REST API)

  • Oct 15, 2024 3:06 PM UTC
  • 3 replies
  • 294 views
  • Translate All

Hi everybody,

Is there a native way to using the REST API to filter the list of ProjectTasks (for example) based on a single Attribute’s value?

 

I tried a couple things for the $filter. I tried referencing attributes as if it they weren’t an array, like so.

Attributes/AttributeID eq 'SCOPE' and Attributes/Value eq 'Test'

But I got this error: “The parent value for a property access of a property 'AttributeID' is not a single value. Property access can only be applied to a single value”

 

Then I tried using the `any` lambda, referenced here:

Attributes/any(a: a/AttributeID eq 'SCOPE' and a/Value eq 'Test')

But I got this error: “The method or operation is not implemented.”

 

Is there any way to do this?

Best answer by Dmitrii Naumov

@sean5 filtering based on a detail entity is not supported. You can only filter by a field of the top level entity or linked entity.

View original

3 replies

darylbowman
Captain II
Forum|alt.badge.img+17

Have you tried using $expand=Attributes in your string to specify that it needs to include that node?

 

Alternatively, this might help, although it’s more complicated.

Translate

Dmitrii Naumov
Community Manager
Forum|alt.badge.img+7
  • Community Manager
  • Answer
  • Oct 15, 2024 5:48 PM UTC

@sean5 filtering based on a detail entity is not supported. You can only filter by a field of the top level entity or linked entity.

Translate

  • Author
  • Freshman I
  • Oct 16, 2024 4:59 AM UTC

Understood, thanks @Dmitrii Naumov 

Translate