OData is a powerful protocol for accessing and manipulating data across different platforms. In this guide, you’ll learn how to consume OData in Mendix, connect external data sources, retrieve data using filters and queries, and display it in your Mendix app. Whether you’re integrating with third-party APIs or internal services, this step-by-step tutorial will help you efficiently work with OData in Mendix..
I am consuming this OData in this application but you can consume it in another application as well.
IMPORTANT :- Where will you find your metadata & Service URL?
Just open your previously created application where you published your OData services & Open POS_Book -> Go to Settings tab & Copy your both links to use here.
Remember, we need to start the localhost server of our first application because we are testing this on localhost if you are consuming it in another application.

Go to MX Studio Pro -> right click on OData Module -> click on other-> Consumed OData Service & give the name COS_Book.

After clicking on Consumed OData Service you will get this pop up. Paste your metadata link here & Click ok.

After clicking Ok you will get a new pop up where you have to add Service URL, But first we have to make Constant to use Service URL.

Just click on Select & Make a new Constant CONS_ServiceURL.

After clicking Ok just paste your Service URL.

Click on View → Data Hub. You will notice that a new tab called Data Hub has been added on the right-hand side.

Go to Domain Model → Data Hub, You will see that you can access the Book entity here. You can perform the operations you defined when publishing the OData service. Drag & Drop the Books entity here.

I defined a read operation. So I will perform them here & show you.
Read Operation :- Right click on OData module -> add a native page -> Take a Listview -> In the DataSource select Database & Select Books entity. Add your all attributes which you want to show.


Lastly, Go to Navigation -> Native mobile (tablet & phone) -> Add New Item -> COS_Book & select COS_Book Native Page.

Now run the application & test it.

Conclusion:
I hope this article has helped you understand How to Consume OData in Mendix Native.
Thanks for reading this! See you in the next blog post.
You can explore the complete ODATA Series here.
