How to consume an OData Service | Mendix (Banner Image)
How to consume an OData Service | Mendix

How to consume an OData Service | Mendix

Mendix With Me
Mendix Community
Published in
5 min readMar 26, 2024

--

In this blog post, I will teach you how to use Consume OData Services in Mendix!

Prerequisites to this tutorial

Step by Step

  1. Start by accessing OData Service (https://services.odata.org/)
OData Service page

2. Click on the first link to visualize the service

Link to access the service
OData Service Structure

3. In Studio Pro, Right-click on your module →Add Other and select Consumed OData service

Create a Consumed OData Service

4. Insert a name and select the option URL

OData Service Name

5. Go back to the browser and copy the URL

Service URL

6. Paste on the Metadata URL field and add ‘$metadata’ at the end of the URL.

Service URL Metadata

7. Create a new constant called ‘ServiceURL’

Create Constant
Constant Name

8. As a default value insert the link copied on point 5

Constant Value — Service URL

9. On the Connection section, fill the Service URL with the constant created

Connection — Service URL

10. Go to the “Integration” tab (if you don’t have one, go to the top menu → View and click Integration) and check the service

OData Service on the Integration tab

11. Drag and drop the entity Products to your domain model

Products Entity from the service

12. To check the associations between the entities you can also drag and drop the entity Categories

Association from the service

13. Double-click on the Products entity, go to Access Rules and create a new one.

Access Rules — Products

14. Do the same for the Categories entity

Access Rules — Categories

15. Right Click on the Product entity and click to Generate Overview pages

Option to Generate Overview Pages — Products
Generated Overview pages

16. Add the Products_Overview page to the Navigation

Navigation

17. Permit the user role to access the pages Products_Overview and Products_NewEdit

Page permissions

18. Click to Run

Run Server

19. Click to open the Products page to check if everything went well

Products Page

The end of the tutorial.

I hope you enjoyed this tutorial on how to Consume an ODATA Service in Mendix 10. For more content like this make sure to check out my YouTube channel “Mendix With Me” for the video that inspired this blog and other tutorial videos.

I’m creating a Mendix community on Discord to make life easier for devs. You can ask questions, help other people, and have access to all the tutorials.
If you want to be part of this community, you can do so through this invite.

Read more

From the writer

If you enjoyed this article you can find more on our Medium page. For great videos, you can visit our YouTube page.

Are you interested in getting more involved with our community? Join us on our Discord Community Channel.

From the Publisher -

Inspired by this article to bring your ideas to life with Mendix? Sign up for a free account! You’ll get instant access to the Mendix Academy, where you can start building your skills.

For more articles like this one, visit our Medium page. And you can find a wealth of instructional videos on our community YouTube page.

Speaking of our community, join us in our Slack community channel. We’d love to hear your ideas and insights!

--

--

Mendix With Me
Mendix Community

Ricardo Pereira: Certified Mendix Expert from Portugal 🇵🇹 | Founder of Mendix With Me community | Join us on Discord: discord.gg/YHre8dXz3q