Skip to main content
Solved

Filter based on a single Attribute value (REST API)

  • October 15, 2024
  • 3 replies
  • 189 views

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.

3 replies

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

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.


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • Answer
  • October 15, 2024

@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.


  • Author
  • Freshman I
  • October 16, 2024

Understood, thanks @Dmitrii Naumov