When App Connect makes a request to an SAP OData service, the response is returned as an OData collection of structured entries. The entries are enriched with a __metadata name/value pair whose value is a JSON object of name/value pairs. For more information about __metadata, see the OData documentation.

An OData collection is typically represented as an Atom feed with an XML-based format, or as an array of JSON objects, as shown in the following examples.

Example 1: OData V2 XML-based Atom format for an SAP OData service response

In this response, an XML format was returned for this sample API call (made via a browser):$top=1

<feed xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="">
  <title type="text">BusinessPartnerSet</title>
  <link href="BusinessPartnerSet" rel="self" title="BusinessPartnerSet"/>
  <entry m:etag="W/"datetime'2019-07-02T20%3A52%3A24.0000000'"">
    <title type="text">BusinessPartnerSet('0100000000')</title>
    <category term="GWSAMPLE_BASIC.BusinessPartner" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
    <link href="BusinessPartnerSet('0100000000')" rel="edit" title="BusinessPartner"/>
    <link href="BusinessPartnerSet('0100000000')/ToSalesOrders" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ToSalesOrders" type="application/atom+xml;type=feed" title="ToSalesOrders"/>
    <link href="BusinessPartnerSet('0100000000')/ToContacts" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ToContacts" type="application/atom+xml;type=feed" title="ToContacts"/>
    <link href="BusinessPartnerSet('0100000000')/ToProducts" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ToProducts" type="application/atom+xml;type=feed" title="ToProducts"/>
    <content type="application/xml">
      <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
        <d:Address m:type="GWSAMPLE_BASIC.CT_Address">

Example 2: OData V2 JSON format for an SAP OData service response

For this response, an OData JSON format was requested using the $format query parameter in the sample request call:$top=1&$format=json

  "d" : { 
    "results":  [ 
        "__metadata": {

Accessing or exposing OData __metadata information in an SAP OData service response

In App Connect, the OData __metadata information is available as an odata_details object, but is not explicitly exposed for mapping because it’s not used routinely, and requires an understanding of OData metadata. If you have an advanced use case requirement for this metadata, you can access or expose it either by using the JSON parser or a JSONata expression.

Using a JSON parser node in the flow

The following example shows a set of standard response fields that were returned for a sample SAP OData Retrieve action.

  • Example of standard response fields for an SAP OData Retrieve action

    Standard response fields for a sample SAP OData Retrieve action

To expose the odata_details object in the response, you can use a JSON parser node to parse the response from your SAP OData node by providing sample output schema for the OData metadata.

  • Example of JSON parser node entries

    Sample output schema for the OData metadata in the JSON parser

The JSON parser response will then expose the odata_details object and object properties, as shown in the following example, and you can directly map to the odata_details properties in the JSON parser response:

  • Example of standard response fields and metadata fields exposed by a JSON parser

    Standard response fields and metadata fields exposed by a JSON parser

Using a custom JSONata expression to reference the odata_details object

You can directly add odata_details in a JSONata expression by using the following notation:

  • Type a JSONata expression directly into a field with .odata_details appended.

    Typed JSONata example

  • Edit a mapped value in a field to append .odata_details.

    Mapped JSONata example

Join The Discussion

Your email address will not be published. Required fields are marked *