> For the complete documentation index, see [llms.txt](https://docs.wem.io/platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wem.io/platform/wemtipsandtricks/working-with-data/expose-your-data-via-odata.md).

# Expose your data via OData

WEM supports **OData V3**. OData is an open protocol that allows you to consume or expose data through simple web requests. It builds upon the ideas of REST. Introduced by Microsoft in 2007, it is adopted by OASIS as a standard and supported by [a large number of applications](http://www.odata.org/ecosystem/).

OData is comparable with ODBC and JDBC, as it allows you to communicate with an (often relational) database in a similar manner. It allows you to query, insert, edit or delete data, all through simple HTTP requests. An OData service shares the schema of the exposed data, which makes it possible for the client application to discover all the table and column definitions.

With WEM, you can both consume external OData sources and expose the database of your application as an OData service. In this blog post I will show you how to do the latter.

### Example application

For this article we created a simple WEM application that stores product information about laptops, tablets and smartphones. This application is accessible via [https://odata-demo.live.wem.io](https://odata-demo.live.wem.io/).

{% hint style="info" %}
**OData Demo Application:**

Base URL: [https://odata-demo.live.wem.io/odata/](https://odata-demo.live.wem.io/odata)

Metadata: <https://odata-demo.live.wem.io/odata/$metadata><br>

Username:`demo` \
Password: `Demo1234!`
{% endhint %}

### Enabling OData

Enabling OData for your WEM application is as simple as creating an OData Account for accessing your Project's Data. You can do this on the [**Project Settings**](/platform/wemmodeler/project-settings.md) page, in the **Security Panel**. Here you can create a new OData Login. Make sure that the password is secure, because these login credentials allows anyone with the information direct access to the data of your WEM application.

![Create OData Login Credentials](/files/nCuQTzTMMJTjonr6aVuf)

On the next step you can determine the level of access:

* **Full access:** \
  these credentials will allow Read, Update, Insert and Delete on all datalists in your project;
* **Restricted access:**\
  Define the proper access to specific lists and for specific actions

![Determine the level of access for the OData Login](/files/VpEKD40n3t5NT8JEbfgb)

To be able to test the OData connection to your application via the Staging or Live URLs, you have to Publish your application to make the OData Login available in the Runtime.

### Test the OData service in the browser

After you have created the OData Login and published your application, you can test the OData service in the browser. Type in the URL of your application followed by **/odata/**. The browser will prompt you for the user credentials.

You should see an XML document that describes which collections (persistent lists) are available in your WEM application. You can also view the detailed schema information by using the Metadata URL (just append **$metadata** to the Base URL).

If you want to learn more about using OData directly from your browser, you can read the [official documentation](http://www.odata.org/documentation/odata-version-3-0/odata-version-3-0-core-protocol/).

### Connect to your application using Excel

{% hint style="info" %}
if you want to use **Excel 2016**, please read the [article that deals with Excel 2016](/platform/wemtipsandtricks/working-with-data/consuming-your-odata-source-with-excel-2016.md) specifically! The steps below don't work for Excel 2016.
{% endhint %}

Excel can connect to any OData source. This allows you to directly view the data, create pivot tables, generate charts, etc. Excel can not modify the exposed data, Microsoft never implemented that feature.

To connect to an OData source from Excel, go to the **DATA** tab, and choose **From Other Sources** and then **From OData Data Feed**. This will start the data connection wizard. The first step asks for the URL and user credentials of the OData connection.

![](/files/MIXlT2fWjbsH4kT7ngBP)

The second step allows you to select which tables you want to connect to. For this example, I just select the **Products** table.

![](/files/kt1MNBPbuSiXXQRyVHS6)

Excel stores the OData connection settings in an external `.odc` file. Afterwards you can reuse this connection via the toolbar icon **Existing Connections**. In the next step you can change the name and location of this file. You can also choose to store the login credentials in the file. For this example, I leave everything unchanged and click on **Finish**.

![](/files/GzbqLyRzuKfEQa7LRMIH)

The final step allows you to configure how you want to show the data in Excel. For this example, I just choose **Table**. This will show all the rows that are stored in database of your WEM application.

![](/files/VQHgnhI5xqocFkIFkgJH)

When this is done, you should see your data in Excel. You can now sort and filter the data using the standard Excel features. Note that Excel won't automatically synchronize the data. To see all the updates since the last time the data was imported, you can click on the button **Refresh All** (found in the **DATA** tab).

![](/files/E9aHtiK3OVP2Dl5XTpJs)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.wem.io/platform/wemtipsandtricks/working-with-data/expose-your-data-via-odata.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
