cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass filters in SAP BTP destination REST API integration in SAP Build Apps

AnjalyGeorge
Explorer
0 Kudos
941

Hi All,
I am trying pass filters in get operation in my SAP BTP Destination Rest API. I am passing query.condition in teh Request header. But I am getting only 2 properties in the filter value and @odata.context.Actualy I need all the properties in value as filters.

Can someone help on how to get the exact properties for filter condition.

Regards,

Anjaly

AnjalyGeorge
Explorer
0 Kudos

daniel.wroblewski Any suggestion on the issue.


Thanks,

Anjaly

AnjalyGeorge
Explorer

xlg00ru
How can I do it using the Formula function in Request header.
I can see only these 2 parameters in the properties. How can I get all the properties using data query

I am using a CPAM service and the response is with below structure

Regards,

Anjaly

Accepted Solutions (1)

Accepted Solutions (1)

Dan_Wroblewski
Developer Advocate
Developer Advocate

The first solution you could do is to connect to your OData service with the "SAP BTP destination REST API integration". You will lose the benefits of the OData integration -- recognizing entities, filtering/paging/sorting -- but you will have control over the query parameters.

  1. Create destination to OData service.
  2. Create REST data resource with destination.
  3. For the list action, set the path to a formula, and make the formula query.search.query.
  4. Create a data variable for the data resource (collection). The data variable logic "Get record collection" will have a place to enter Search object with a single field 'query'. Set this to what you want to return, for example '/Customers?$filter=contains(CustomerID, 'AL')'
  5. When you set this response to your data variable, you will have to cut off the header (one of those things you have to do manually), so the "Record collection" will be set to a formula with this: outputs["Get record collection"].records.value

You will have to set the query string each time you retrieve records, changing the entity and the path.

Here is the data resource, including the list definition and its query parameter.

Here is the data variable logic:

And here is the formula for the query:

You can set this as a page parameter and then just build the value for the page parameter. This is a workaround and I'm sure there are limitations, but you seemingly can set anything you want in the path.

AnjalyGeorge
Explorer

daniel.wroblewski Thanks for the help.It worked for me.

madilkhan
Explorer
0 Kudos
how we can send the dynamic value to the filter.

Answers (0)