Hello,
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’
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.
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." }
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.