Import from Web API: how to filter on multiple criteria

Using the action "Import from Web API" I am able to retrieve records from a table using the $filter option. However, I would like to add a second criteria - similar to another post in this forum (example below) but I'm getting a 400 Bad Request.

Example I would like to recreate:
?$filter=Vkorg eq ‘OV10’ and PNtra eq ‘X’ and PTra eq ‘X’ and PDesp eq ‘X’

Thanks in advance,

Hello André and welcome to the Community!

Can you please post the query with one criterion that works?

Also, try using the "Web request" action instead of "Import from Web API". They are similar except the former doesn't automatically parse JSON/XML but displays the actual response. A "400 Bad Request" response can contain additional details that clarify what exactly the API didn't like about your request.

Also, if you have a link to the API documentation, that would be helpful too.

Hello Dmitry and thank you,
Happy to be here :slight_smile:

To answer your first question, the following request (1 filter criteria) is working normally:
GET$filter=status_id eq 2

... but adding a second filter criteria does not:
GET$filter=status_id eq 2 and status_end_dt eq null

I should mention that both criteria work correctly when used separately but not together.

To answer your second question, when using the Web request action instead, the response-body contains:

{"code": 400, "message": "The filter condition: (filter=status_id eq 2 and status_end_dt eq null) cannot be serviced by any single index. Please refer to ExtendedMetadata.Indexes metadata for all indexed fields. Filtering is only allowed if FieldIsFilteringAllowed is set to true and an index is present which includes the requested field. If the index contains multiple fields, then filter fields must comprise a contiguous sequence of index fields starting from the most significant." }

Finally, about API Documentation, you can find high-level documentation at this link:

I also have a more detailed PDF I can send you later directly if you want.
Many thanks in advance for your input :slight_smile:

This is the root of the problem. Apparently, your API (CSOD) has certain limitations on what filters can be applied and how they must be applied. The combination of filters and their sequence in the query is strictly limited by CSOD settings.

To resolve the problem, show your CSOD developers/admins the error message quoted above and ask them how to apply filters in your query.