# tODataOutput

Inserts, updates, or deletes data from an OData web service.

For a quick introduction on using this component in your Job, see the following video:

## tODataOutput Standard properties

These properties are used to configure tODataOutput running in the Standard Job framework.

The Standard tODataOutput component belongs to the Internet family.

The component in this framework is available in all subscription-based Talend products.

* This component is available only when you have installed the 8.0.1-R2024-01 Talend Studio monthly update or a later one delivered by Talend. For more information, check with your administrator.
* This component only supports OData version 4.x.

## Basic settings

| Properties | Description |
| --- | --- |
| Property type | Either Built-in or Repository<br>.<br><br><ul> <li> <span>Built-in</span>: No property data stored                           centrally.</li> <li> <span>Repository</span>: Select the repository                           file in which the properties are stored. The fields that follow are                           completed automatically using the data retrieved.</li> </ul> |
| Schema and Edit Schema | A schema is a row description, it defines the number of fields to be processed<br>and passed on to the next component. The schema is either<br>Built-in or stored remotely in the<br>Repository.<br><br><ul> <li> <p> <span>Built-in</span>: You create and store the schema locally                           for this component only. For more information about a component schema in                           its <span>Basic settings</span> tab, see <a href="https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/basic-settings-tab" target="_blank">Basic settings tab</a>.</p> </li> <li> <p> <span>Repository</span>: You have already                           created the schema and stored it in the <span>Repository</span>. You can reuse it in various projects and Job                           designs. For more information about a component schema in its                              <span>Basic settings</span> tab, see <a href="https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/basic-settings-tab" target="_blank">Basic settings tab</a>.</p> </li> </ul><br><br>Click Edit<br>schema to make changes to the schema. If the current schema is of the Repository type, three options are available:<br><br><ul> <li> <p> <span>View schema</span>: choose this                option to view the schema only.</p> </li> <li> <p> <span>Change to built-in property</span>:                choose this option to change the schema to <span>Built-in</span> for local changes.</p> </li> <li> <p> <span>Update repository connection</span>:                choose this option to change the schema stored in the repository and decide whether                to propagate the changes to all the Jobs upon completion.</p> <p>If you just want to                propagate the changes to the current Job, you can select <span>No</span> upon completion and choose this schema metadata                again in the <span>Repository Content</span>                window.</p> </li> </ul> |
| Guess schema | Click this button to retrieve the schema according to your settings. This<br>button works when Status, headers and body is selected<br>from the Returned content drop-down list or<br>Output key/value pairs is selected and key/value<br>pairs are set in the table under the Output key/value<br>pairs option.<br><br>When retrieving data from OData, you can specify the format and content of the<br>data retrieved using the schema, the Guess schema<br>button, the Entity set option, the, Specify<br>entity key option, the<br>$filter/search/select/expand option, and the<br>Return type option. |
| Root URL | Type in the URL address identifying the root of the OData<br>service you want to access, for example,<br>https://services.odata.org/V4/xxx. For more<br>information, see [Service Root URL](http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html#_Toc453752336). |
| Authentication type | Select one of the following authentication methods depending on the server<br>security requirements:<br><br><ul> <li> <span>No authentication</span>: no authentication is expected to                        access the server.</li> <li> <span>Basic</span>: A username and a password are expected. For                        more information, see <a href="https://www.rfc-editor.org/rfc/rfc2617" target="_blank">RFC 2617</a>.</li> <li> <span>Digest</span>: A username and a password are expected. For                        more information, see <a href="https://www.rfc-editor.org/rfc/rfc2617" target="_blank">RFC 2617</a>.</li> <li> <span>Bearer token</span>: A raw access token is expected. It                        will be carried into the request header as <span>Authorization: Bearer                           &lt;your token&gt;</span>. </li> <li> <span>NTLM</span>: A username (that may contain a domain name)                        and a password are expected. For more information, see <a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-nlmp/b38c36ed-2804-4868-a9ff-8dd3182128e4" target="_blank">NT LAN Manager (NTLM) Authentication                           Protocol</a>.</li> <li> <span>API key</span> uses a flexible way to pass an API key token                        to the server, including the ability to select where to pass it, its name                        and a prefix: <ul> <li> <span>Destination</span>: Select where the token will be                              set: either in a header with the given name, or in a query parameter                              with the given name (not recommended as the token might be visible in                              the logs).</li> <li> <span>Name</span>: Enter the name of the header or query                              parameter. </li> <li> <span>Prefix</span> (optional): Enter the prefix to be                              added in front of the token (only if the                                 <span>Destination</span> is <span>Request                                 header</span>). </li> <li> <span>Token</span>: Enter the authentication token.</li> </ul> </li> <li> <span>OAuth 2.0</span> automatically manages the retrieval and                        renewal of the access token against the OAuth server then passes it to the                        target endpoint as a bearer token:<ul> <li> <span>Flow</span>: The OAuth flow you want to execute.                              Currently, only the <a href="https://www.rfc-editor.org/rfc/rfc6749#page-9" target="_blank">Client Credentials</a> flow is supported.</li> <li> <span>Authentication mode</span>: For all authentication                              methods supported, the flow and scope parameters are set in the body                              in the format <span>application/x-www-form-urlencoded</span>, with                              keys <span>grant_type=xxx&amp;scope=xxxx</span>.</li> <li> <span>Token endpoint</span>: Enter the authentication token                              using the format <span>oauth2/mydomain.com/token</span>.</li> <li> <span>Client ID</span> and <span>Client                                 secret</span>: Enter the client ID and client secret.</li> <li> <span>Scopes</span>: Enter the scope. If not set, the scope                              key is not added in the body form.</li> </ul> </li> </ul><br><br>Information noteTip: To enter a password, a token, or a client<br>secret key, click the [...] button next to the<br>corresponding field to bring out the Enter a new<br>password dialog box, enter the password, the token, or the<br>secret key in the text field, and click OK. Note that<br>you can enter either a JSON string in the pure password mode<br>or a Java expression in the Java mode. You can toggle<br>between the two modes by clicking switch to Java mode or<br>switch to pure password mode on the top of the text<br>field. |
| Entity set | Enter or select the specific entity set you would like to<br>retrieve from the service. For more information, see [Addressing Entities](https://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html#_Toc453752340).<br><br>Information noteTip: To visualize all available entity sets,<br>click the [...] button next to the corresponding field<br>to bring out the Retrieve values dialog box, and click<br>Run in background. A new dialog box opens with all<br>the retrieved entity sets you can select. Note that you can also provide a<br>Custom value by selecting the Use custom<br>value check box.<br><br>This option impacts the schema of the output flow of this component. It is<br>recommended to update the schema by clicking the Guess<br>schema button after setting the key/value pairs in the table<br>under this option. |
| Output action | Select an operation to be performed from the drop-down list.<br><br><ul> <li> <p> <span>Insert</span>: Inserts new records in the previously                           defined entity set.</p> </li> <li> <p> <span>Update</span>: Modifies existing records in the                           previously defined entity set. The available update types are                              <span>Patch</span> (updates existing records with modified                           properties), or <span>Replace</span> (overwrites existing                           records with new ones).</p> </li> <li> <span>Delete</span>: Deletes existing records in the previously                        defined entity set.</li> </ul> |
| Specify the request<br>configuration | Select this option to configure your request.<br><br><ul> <li> <span>Key value</span>: Enter the existing value you want to                           update or delete.<p>This option is only available if you select either                                 <span>Update</span> or <span>Delete</span> from                              the <span>Output action</span> list.</p> </li> <li> <span>Request body</span>: Enter the body of the message you                           want to include in the request. The format needs to match the format                           selected in the <span>Request body format</span> field.<div>JSON                              example: <pre><code><pre><code><code>{ "id": "184", "lastname": "Truce", "age": "37", }</code></code></pre></code></pre> </div> <p>This option is only available if you select                              either <span>Insert</span> or <span>Update</span>                              from the <span>Output action</span> list.</p> <div>XML example:                              <pre><code><pre><code><code>&lt;user&gt; &lt;id&gt;184&lt;/id&gt; &lt;name&gt;Truce&lt;/name&gt; &lt;age&gt;37&lt;/age&gt;&lt;/user&gt;</code></code></pre></code></pre> </div> </li> <li> <span>Request body format</span>: Set the body format by                           selecting the corresponding option.</li> </ul> |

## Advanced settings

| Properties | Description |
| --- | --- |
| tStatCatcher Statistics | Select this check box to gather the Job processing metadata at a Job<br>level and at each component level. |
| Use custom authorization token header | Select this check box to enter a custom authorization token header name. The<br>default header name is Authorization.<br><br>This option is<br>available when OAuth 2.0 is selected in the<br>Authentication type option in the Basic<br>settings of the component. |
| Use custom token prefix | Select this check box to enter a custom token prefix. The default token<br>prefix is Bearer. If you do not have a token prefix, leave<br>this field empty.<br><br>This option is available when OAuth 2.0<br>is selected in the Authentication type option in the<br>Basic settings of the component. |
| Connection timeout (ms) | Set the timeout period (in milliseconds) for the connector to establish a<br>connection to the server. An error occurs if an attempt to establish a<br>connection fails. |
| Receive timeout (ms) | Set the timeout period (in milliseconds) for receiving response data. An error<br>occurs if no data is received when the read timeout period expires. |
| Use a proxy | Select this option to use an HTTP or a SOCKS proxy.<br><br><ul> <li> <span>Proxy type</span>: Select the type of proxy you want to                        use: <span>HTTP</span> or <span>SOCKS</span>. The HTTP                        proxy support basic authentication.</li> <li> <span>Proxy host</span> and <span>Proxy port</span>:                        Enter the address and port of the proxy.</li> <li> <span>Proxy login</span> and <span>Proxy                           password</span>: Enter the credentials needed to authenticate to the                        proxy. These two fields are available when <span>HTTP</span> is                        selected from the <span>Proxy type</span> drop-down list.</li> </ul> |
| Accept header and Headers | Use these options to define some request headers as name-value pairs.<br><br><br>Talend supports If-Match headers. For more information see<br>[If-Match](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-odata/c3569037-0557-4769-8f75-a91ffcd7b05b). |
| Use custom URL parameters | Select this check box to specify the parameters that will be set in the query<br>URL after the ? character in the form of name-value pairs. |
| Body charset | Enter the encoding type of the requested body.<br><br>This option is only available if the<br>Insert/Update option and the<br>Specify the request check box are selected in the<br>basic settings. |

## Global Variables

| Variables | Description |
| --- | --- |
| ERROR\_MESSAGE | ERROR\_MESSAGE: the error message generated by the<br>component when an error occurs. This is an After variable and it returns a string. This<br>variable functions only if the Die on error checkbox is<br>cleared, if the component has this checkbox. |
| NB\_LINE | NB\_LINE: the number<br>of rows read by an input component or transferred to an output component. This is an<br>After variable and it returns an integer. |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | This component can be used as intermediate step in a data flow or as an end object in the Job flowchart. |

**Related tasks**

* [Inserting and updating data using OData web services](https://help.qlik.com/talend/en-US/components/8.0/internet/tfixedflowinput-todatainput-todataoutput-tlogrow-retrieving-and-updating-data-standard-component "The following Job demonstrates how to insert data into an OData service using fixed data, then update inserted records using tODataInput and tODataOutput components.")