# tODataInput

Retrieves data from an OData web service. With this component, you can send parameters in URLs, headers, and bodies to query the information you need from the OData web service.

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

## tODataInput Standard properties

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

The Standard tODataInput 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<br>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> |
| Root URL | Type in the URL address identifying the root of the OData service you want<br>to access, for example, https://services.odata.org/V4/xxx.<br>For more 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<br>client 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 want to retrieve from the<br>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, click the<br>[...] button next to the corresponding field to bring<br>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<br>output flow of this component. It is recommended to update the schema by<br>clicking the Guess schema button after setting the<br>key/value pairs in the table under this option. |
| Specify entity key | Select this check box to enter the key used to uniquely identify a specific<br>entity set. 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>This option<br>impacts the schema of the output flow of this component. It is recommended to<br>update the schema by clicking the Guess schema button<br>after setting the key/value pairs in the table under this option. |
| Use $filter | Select this check box to enter a query that will filter the collection of<br>resources that are addressed by the request URL. For more information, see [System Query Option $filter](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#_Filter_System_Query).<br><br>If both<br>the Use $filter and Use $search<br>options are applied to the same request, the results include only the entities<br>that match both criteria.<br><br>This option impacts the schema of the output<br>flow of this component. It is recommended to update the schema by clicking the<br>Guess schema button after setting the key/value pairs<br>in the table under this option. |
| Use $search | Select this check box to enter a query that will be applied to the request<br>URL and will return all matching entities in the collection. For more information,<br>see [System Query Option $search](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#_Toc453752364).<br><br>If both<br>the Use $filter and Use $search<br>options are applied to the same request, the results include only the entities<br>that match both criteria.<br><br>This option impacts the schema of the output<br>flow of this component. It is recommended to update the schema by clicking the<br>Guess schema button after setting the key/value pairs<br>in the table under this option. |
| Use $select | Select this check box to enter a query that will be applied to the request<br>URL and will return a specific set of properties for each entity or complex type.<br>For more information, see [System Query Option $select](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#_Toc453752360).<br><br>If both<br>the Use $select and Use $expand<br>options are applied to the same request, the results include only the entities<br>that match the $select criteria, so in that case you should include the $expand<br>criteria in the $select query in order to return all expected<br>properties.<br><br>This option impacts the schema of the output flow of this<br>component. It is recommended to update the schema by clicking the<br>Guess schema button after setting the key/value pairs<br>in the table under this option. |
| Use $expand | Select this check box to enter a query that will be applied to the request<br>URL and will return the related expanded resources to be included in line with<br>retrieved resources. For more information, see [System Query Option $expand](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#_Toc453752359).<br><br>If both<br>the Use $select and Use $expand<br>options are applied to the same request, the results include only the entities<br>that match the $select criteria, so in that case you should include the $expand<br>criteria in the $select query in order to return all expected<br>properties.<br><br>This option impacts the schema of the output flow of this<br>component. It is recommended to update the schema by clicking the<br>Guess schema button after setting the key/value pairs<br>in the table under this option. |
| Return type | Select one of the options depending on how you want to parse the data<br>returned by the server.<br><br><ul> <li> <p> <span>Record</span>: Parses the response body and generates                           records (one entity per row).</p> </li> <li> <span>Raw</span>: Returns the full response body in a                           <span>body</span> column as is.</li> </ul> |
| Schema and Edit Schema | A schema is a row description, it defines the number of fields to be<br>processed 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 from<br>the Returned content drop-down list or Output<br>key/value pairs is selected and key/value pairs are set in the<br>table under the Output key/value pairs option.<br><br>When<br>retrieving data from OData, you can specify the format and content of the data<br>retrieved using the schema, the Guess schema button, the<br>Entity set option, the, Specify entity<br>key option, the<br>$filter/search/select/expand option, and the<br>Return type option. |

## Advanced settings

| Properties | Description |
| --- | --- |
| tStatCatcher Statistics | Select this check box to gather the Job processing metadata at a Job level<br>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 connection<br>fails. |
| Receive timeout (ms) | Set the timeout period (in milliseconds) for receiving response data. An<br>error 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<br>Headers | Use these options to define the set of accepted formats for header requests<br>as name-value pairs. For more information, see [Header Accept](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_HeaderAccept).<br><br>If you selected<br>Record as the return type in the Basic<br>settings tab, you might need to replace<br>odata.metadata=minimal with<br>odata.metadata=full in the Accept<br>header field in order to correctly parse all non-String<br>primitive types. |
| Use custom URL parameters | Select this check box to specify the parameters that will be set in the<br>query URL after the ? character in the form of name-value<br>pairs. |
| Use $skip | Select this check box to specify the number of items in the queried<br>collection that are to be skipped and not included in the result. For more<br>information, see [System Query Option $top and $skip](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#_Top_and_Skip).<br><br>If<br>both the Use $skip and Use $top<br>options are applied to the same request, the results include only the entities<br>that match both criteria.<br><br>This option impacts the schema of the output<br>flow of this component. It is recommended to update the schema by clicking the<br>Guess schema button after setting the key/value pairs<br>in the table under this option. |
| Use $top | Select this check box to specify the number of first items in the queried<br>collection that are to be included in the result. For more information, see [System Query Option $top and $skip](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#_Top_and_Skip).<br><br>If<br>both the Use $skip and Use $top<br>options are applied to the same request, the results include only the entities<br>that match both criteria.<br><br>This option impacts the schema of the output<br>flow of this component. It is recommended to update the schema by clicking the<br>Guess schema button after setting the key/value pairs<br>in the table under this option. |
| Use $orderBy | Select this check box to enter a query that will be applied to the request<br>URL and will return the related resources in a particular order. For more<br>information, see [System Query Option $orderby](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#_OrderBy_System_Query).<br><br>This<br>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. |

## 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<br>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.")