Skip to main content Skip to complementary content

Inserting and updating data using OData web services

The following Job demonstrates how to insert data into an OData service using fixed data, then update inserted records using tODataInput and tODataOutput components.

Before you begin

This scenario uses OData web service capabilities to retrieve and update data. For more information, see OData documentation. You will need access to an OData v4.x service endpoint with appropriate authentication credentials.

Linking the components

Procedure

  1. Drag and drop the following components from the Palette: tFixedFlowInput, tODATAOutput, tODATAInput, and tLogRow.
  2. Connect tFixedFlowInput to tODATAOutput using a Row > Main connection.
  3. Connect tODATAOutput to tODATAInput using a Trigger > On Subjob Ok connection.
  4. Connect tODATAInput to tLogRow using a Row > Main connection.
    Overview of the Job in the Studio showing the OData components connected.

Configuring the components

Procedure

  1. Double-click the tFixedFlowInput component to display its Component view.
  2. In the Basic settings view, configure the fixed data to insert into the OData service.
    Click Edit schema and define the schema matching the OData entity structure. For example, for a Person entity:
    • UserName (String)
    • FirstName (String)
    • LastName (String)
    • Email (String)
    In the Mode area, select Use Single Table and click the [+] button to add sample records with appropriate values for each column.
    Basic settings view of the tFixedFlowInput configuration showing inline data with people fields.
  3. Double-click the tODATAOutput component to display its Component view.
  4. In the Basic settings view, configure the output operation.
    • In the Root URL field, enter the URL of your OData service, for example: https://services.odata.org/V4/ABCD for the TripPin reference service.
    • In the Authentication type list, select the appropriate authentication method, for example No authentication.
    • Click Sync columns to retrieve the schema from the previous component.
    • In the Entity set field, enter or select the target entity set, for example: People.
    • In the Output action list, select Insert to add the new records to the OData service.
    Basic settings view of the tODATAOutput configuration showing entity set and insert operation.
  5. Double-click the tODATAInput component to display its Component view.
  6. In the Basic settings view, configure the connection to retrieve the inserted data.
    • In the Root URL field, enter the same OData service URL used in tODATAOutput.
    • In the Authentication type list, select the same authentication method.
    • In the Entity set field, enter the same entity set, for example: People.
    • In the Return type list, select Record to parse the response into individual records.
    Click Guess schema to automatically retrieve the schema based on the entity set.
    Basic settings view of the tODATAInput configuration showing URL, entity set, and schema.
  7. Double-click the tLogRow component to display its Component view.
    Click Sync columns to retrieve the schema from the previous component.
    In the Mode area, select Basic to display the retrieved data in the console in plain text

Executing the Job

Procedure

  1. Press Ctrl + S to save your Job.
  2. Press F6 to execute it.

Results

The Job inserts the fixed data records into the OData service, then retrieves all records from the same entity set and displays them in the console. This demonstrates a complete write-and-read cycle using OData web services for data integration.

Execution console showing successful retrieval and processing of OData records.

What to do next

Now if you want to update some information in the OData entity, for example to change a first name to a preferred name, you can:
  • Edit the tFixedFlowInput component configuration to keep only the entity and name to be changed, for example changing Johnathan to John.
    Basic settings view of the tFixedFlowInput configuration showing inline data with Person fields.
  • Edit the tODATAOutput component configuration to select Update as Output action and Patch as Update type, in order to overwrite the existing record.
  • Execute the Job again. The person record has been updated and the new first name value is displayed in the Run console.
    Execution console showing successful update of OData record.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!