Odata REST filtering

2
Hi everyone, I have just started using Mendix and currently working on a project where we want to display data on a page using API and have a search option to filter this data (sort what's get returned). From what I have heard from other developers- Mendix cannot currently apply filters to an OData,  so it would have to be translated into a REST Service. Which is where I need help, since I am very new to this and I have no experience with REST. So far I managed to display the data, but unable to filter it. Any tips and guidlines would be highly appreciated. Thanks in advance. ^^
asked
2 answers
3

Hi Plamena,

 

OData calls are simply REST services with additional parameters. So using a microflow you can call a OData service using the Mendix native REST connector. You can then pass in the REST call OData parameters in the URL call.

For example:

http://services.odata.org/OData/OData.svc/Category(1)/Products?$top=2&$orderby=name

So all you need to do is build a search field on your Mendix page then pass this data to the Microflow to pass the search data to the URL and order parts.

Regards

Simon

answered
2

Did you see this part of the documentation: https://docs.mendix.com/refguide/odata-query-options

Have not yet played with it myself, but depending on what you want to filter you might be lucky.

Regards,

Ronald

 

answered