Skip to main content

Celonis Product Documentation

Adding custom tables and columns to Coupa extraction

When connecting your Coupa tenant to the Celonis Platform , you can also supply a custom JSON configuration. This custom JSON configuration enables you to add custom tables and columns to be extracted from your Coupa tenant in addition to those supported by default.

To learn how to connect to your Coupa tenant, see: Coupa.

Formatting your JSON

When formatting your JSON string, the following components are needed:

General structure

The metadata JSON should contain the following objects:

  • version: This should be the value of the Coupa API version that you're using.

  • metadataSources: This is the URL used to access the table over Coupa API and the table names to which the URL applies.

  • resources: List of tables and custom objects.

And the example of how the JSON is formatted:

{
  "version": "R27",
  "metadataSources": [

   ],
   "resources": [
    
   ]
}
Metadata sources

Your metadata sources should then be added using the following objects:

  • Resource_name_value: This should be a URL.

  • display_name_value: This can be a text-based name for the source.

And the example of how the JSON is formatted:

{
 "url": "resource_name_value",
 "targetResources": [
   "display_name_value"
 ]
}
Resources

The resource section is where you can detail your columns, nested fields and nested arrays. To do this, you need the following objects:

  • displayName: Custom name of the table where the resource will be extracted to.

  • availableSince: Supported version of the Coupa API.

  • resource: Resource name in the Coupa tenant.

And the example of how the JSON is formatted:

{
      "displayName": "display_name_value",
      "availableSince": "R21", 
      "resource": "resource_name_value",
......
}
Columns

This section should include the columns you want to extract from your Coupa tenant, with the following information needed:

  • Column name

  • Column type

  • Primary key (added as primaryKey = true value)

The backend will add the foreign key for the nested tables. It is also possible to add the field with nested fields as a column instead of creating nested fields in the configuration. However, the values of the columns will be JSON string.

And the example for how the JSON is formatted:

{  
"resources": [
  {
      .....
      "columns": [
        {
          "name": "id",
          "type": "INTEGER",
          "primaryKey": true
        },
{
          "name": "ColumnA",
          "type": "Type"
        },
    {
          "name": "ColumnB",
          "type": "Type"
        },
    ....
      ],
      .....
   }
Nested fields

This section should include any nested fields you want to extract from your Coupa tenant. The following objects are needed:

  • column_name_nested_field: The name for the new column of the nested field, added using the format: (column name + _ + nested field name)

  • column_name: Column name of the table which has nested fields.

  • nested_field: Nested field name.

And the example for how the JSON is formatted:

{
  "resources": [
    { 
     ............
      "nestedFields": [
        {
          "name": "column_name_nested_field",
          "pathToField": [
            "nested_field" 
          ],
          "parentName": "column_name",
          "type": "TYPE"
        }
      ]
    ............
  ]
}
Nested arrays

In the nested array, you need to mention all the fields which have nested fields in the nested fields section. Otherwise, you should add them to the column section to be able to see them in the nested table. If the columns of the nested table will have a list of objects, you need to add a new nested array to the nested array configuration.

The following objects are needed for this:

  • main_table_name_column_name: The name for the nested table, using the format: (display name of the table + _ + column name).

  • column_name: The column name in the table which has the list of objects.

And the example for how the JSON is formatted:

{
  "resources": [
    .......................
      "nestedArrays": [
        {
          "nestedTableName": "main_table_name_column_name",
          "path": [
            "column_name"
          ],
          "columns": [
            {
              "name": "id",
              "type": "INTEGER"
            },
         .......
          ],
          "nestedFields": [
              ...........
          ]
       "nestedArray": [
..........
   ]
        }
      ]
     ...........
    }
  ]
}
Example JSON script

The following is an example of how you can use the payment API to customize your metadata JSON:

{ 
  "version": "R27",
  "metadataSources": [
{
     “url”: “payments”,
      “targetResources”: [
        "payments"
      ]
}
   ],
  "resources": [
    {
      "displayName": "payments",
      "availableSince": "R21",
      "resource": "payments",
      "filteringEnabled": true,
      "fieldSelectionEnabled": true,
      "paginationEnabled": true,

      "columns": [
        {
          "name": "id",
          "type": "INTEGER",
          "primaryKey": true
        },
{
 "name": "created-at",
 "type": "DATETIME"
},
{
 "name": "updated-at",
 "type": "DATETIME"
},
{
 "name": "status",
 "type": "STRING"
},
    {
 "name": "pay-from-total",
 "type": "DECIMAL"
},
    {
 "name": "pay-to-total",
 "type": "DECIMAL"
}
      ],
      "nestedFields": [
        {
          "name": "created-by_email",
          "pathToField": [
            "email" 
          ],
          "parentName": "created-by",
          "type": "STRING"
        },
{
          "name": "created-by_employee-number",
          "pathToField": [
            "employee-number" 
          ],
          "parentName": "created-by",
          "type": "STRING"
        }
      ]
}