> 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/wemmodeler/services-and-integration/remote-data-sources.md).

# Remote Data Sources

## OData (Open Data protocol) <a href="#odata-open-data-protocol" id="odata-open-data-protocol"></a>

*"Open Data Protocol (OData) is an open protocol which allows the creation and consumption of queryable and interoperable RESTful APIs in a simple and standard way."* The WEM Modeler uses OData to access the database of an external system. And in order to do that, you need to specify where that database resides and what data can be accessed. Once WEM has this information, you can directly access the data from e.g. an interaction node. We call a system that is accessed through Data a `Remote data source`.

### Defining (consuming) a new Remote data source <a href="#defining-consuming-a-new-remote-data-source" id="defining-consuming-a-new-remote-data-source"></a>

Setting up a new `Remote data source` is very simple. Follow these steps:&#x20;

* Go to the `Remote data source` node in the Project tree. Click on `Add data service`.&#x20;
* Give the service a name, this is the name that WEM will use for this particular data service.&#x20;
* You can now add a URL, and if needed, fill in the Username and Password for the source.&#x20;
* Based on these credentials the remote data source gives access to the database, including the specific rights this user has (insert, update, delete rights).&#x20;

![](/files/gMAmsDtFPvI5OfrcMXtX)

### Updating the data service <a href="#updating-the-data-service" id="updating-the-data-service"></a>

If the metadata or data model changes the service needs the current information. To update the service itself, click on the `update odata service definition` button and WEM will update the data service. This can be found by right clicking the service you want to change or opening the context menu with the 3 dots when you have the intended service selected.&#x20;

Alternatively, manually update the OData source by selecting 'Edit Settings' from the same context menu. This opens a window where you can update the name, service URL, settings for File URL's and batch optimization, the credentials for preview staging and live and service root URL's.&#x20;

<figure><img src="/files/EeoawZ4CqkjRrKkfDryw" alt=""><figcaption></figcaption></figure>

### Using the remote data source <a href="#using-the-remote-data-source" id="using-the-remote-data-source"></a>

Once the remote data source is specified, it can be accessed via the WEM Modeler. Everywhere in WEM where you can access data, you can access this remote data source. E.g. if you are working an interaction node, the list(s) that represent the remote data can be found in the webservice tab of the resource pane under the specified datasource. Or when you create an expression using the expression editor, you can access the same remote data source lists and fields.

## Exposing your WEM application using OData <a href="#exposing-your-wem-application-using-odata" id="exposing-your-wem-application-using-odata"></a>

It is possible to expose your WEM application's data using the OData protocol. When you do this, external systems can access the data of your application using OData. Exposing OData is very straightforward:

1. Create user credentials that will be used by external systems to access the data of your application. The credentials can be found in the settings tab under the security settings on the right. Here you you can manage and add access to the OData lists and user access settings.&#x20;
2. After you have created the user credentials you specify which list(s) in your data model are exposed to that user (and therefore to the external system);
3. Here you can also specify for each list which operations are available to that user (and therefore to the external system).

Once the steps above have been executed, your application is accessible via OData. **Note**: exposing your application via OData is always done **per portal**. In other words, you need to specify access per portal.

The next sections describe each step in more detail.

### Manage OData Users <a href="#manage-odata-users" id="manage-odata-users"></a>

Managing OData users is done via the [security settings](/platform/wemmodeler/project-settings/security-settings.md) found on the [project setting](/platform/wemmodeler/project-settings.md) page. When you go to the project settings and click on OData logins, you will see the following window open:

![](/files/vm3Ehc2G4dYZS0O1ExGR)

Here you can manage, add and see all active OData logins and control their access level. In the first column you can see the username used to log in to the service and the Portal column is where you specify either one or all portal used by the service for each user.&#x20;

Management of the data list that is available for each user is managed by clicking the blue access link in the third column. This will open a new window called access control for 'username', here you select the access level and which specific lists are available through Odata. First you choose between giving full access and a restricted access, with the restricted setting allowing you to choose specific lists like the image below. More about this at the end.&#x20;

<figure><img src="/files/zibqpZ6Ahq38FvJzZJno" alt=""><figcaption></figcaption></figure>

When you click on ![](/files/s6ao3Nl3QTgQI3tuVXNJ) in the top left of the Odata logins window this popup appears:

<figure><img src="/files/7oIYQTNdGOJNk9IXGwqj" alt=""><figcaption></figcaption></figure>

This is the first page to add a new OData login user to your project. Here you set up the name/username, password and the portal(s) you want to provide access to. When this is filled in correctly you can go to the next page for the access level settings. This is the same screen as managing existing users access level. When you are done you save the user with the create button.&#x20;

Deleting users can be done from the OData logins screen from earlier. In this screen the context menu for each user can be opened with the three dots on the right of the window. From here you can also change the access control, change usernames, change passwords and delete the users and its access to the data.

### Specifying Access Control rules <a href="#specifying-access-control-rules" id="specifying-access-control-rules"></a>

Once an OData user has been created, this user can be given access to your application's data. To do this, select the user you want to manage and select `Access control rules`. This will bring up the following screen:

<div><img src="https://531715263-files.gitbook.io/~/files/v0/b/gitbook-28427.appspot.com/o/assets%2F-L_NpOsk0sjotPXNy29Q%2F-L_mjrxoCFlx3Q2zjX20%2F-L_mjw7s54OBuuDTzliO%2Fwem-modeler.expose-odata.access-control-all.png?generation=1552408372105993&#x26;alt=media" alt=""> <figure><img src="/files/zibqpZ6Ahq38FvJzZJno" alt=""><figcaption></figcaption></figure></div>

There are two main options:

1. 1.`Allow full access to all data` - this is the default selection.This option means that the user can access all lists of your application and has the right to insert data, update data or delete data for all the lists in your application. In other words, the user has full control over your application's data;
2. 2.`Specify access rules` This option makes it possible to have very granular control over providing access to your application's data. When this option is selected, you can specify which lists the user has access to and which actions can be performed on this list.

When the first option is selected the individual lists will be greyed out, but when the restricted access is selected you can start allowing to read on specific lists. The other options are available when the read is already selected, users will always need to be able to read the lists before they can get additional rights. Besides being able to read the data in the list you also have the following options:&#x20;

* `Allow insert` - the user (external system) can insert new rows to the selected list;
* `Allow update` - the user (external system) can update data in the selected list;
* `Allow delete` - the user (external system) can delete rows in the selected list.

By selecting one or more options, it is possible to control exactly what the user (and therefor the external system) can do with the selected list.

You can repeat the steps above to select all lists of your application that need to be exposed.


---

# 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:

```
GET https://docs.wem.io/platform/wemmodeler/services-and-integration/remote-data-sources.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
