FAQ KB0399829
Email
OpenAPI: How do I add fields to the Reporting API Custom viewTemplate?
Question

How do I add fields on Reporting API Custom viewTemplate?

Answer

Follow these steps:

  1. Create a custom viewTemplate.
  2. Patch the custom viewTemplate by calling this API endpoint:

    https://openapi.ariba.com/api/procurement-reporting-view/v2/prod/viewTemplates/<nameofCustomViewTemplate>/patch?realm=<RealmName>

    On the body part, specify: (note the real field example mixed in the code)
    {
      "selectAttributes": [
        "Attributes1",
        "Attributes2",
        "Attributes3",
        "cus_Attributes1",
        "cus_Attributes2",
        "StartDate",
        "UniqueId"
    ],
      "filterExpressions": [
        {
         "name": "FilterName",
         "field": "filterExpression1",
         "op": ">=",
         "defaultValue": "YYYY-MM-DDTHH:MI:SSZ"
        },
        {
         "name": "createdDateTo",
         "field": "TimeCreated",
         "op": "<=",
         "defaultValue": "2019-05-31T00:00:00Z"
        },
        {
         "name": "StatusInList",
         "field": "StatusString",
         "op": "IN",
         "defaultValue": [
                          "Submitted"
                         ]
        }
     ]
    }
Additional Information
  1. Only the custom viewTemplate can be modified/patched. The OOTB viewTemplate cannot be modified.
  2. Invoke the Metadata API end point to bring back the available Select Fields and Filter Expressions.
  3. Notice that on custom view, duplicate fields are not allowed.

Applies To

Core Procurement > Procurement REST APIs
Purchasing
Spend Visibility
Strategic Contracts > Strategic Contracts - REST API
Strategic Sourcing > Strategic Sourcing - REST API

Terms of Use  |  Copyright  |  Security Disclosure  |  Privacy