SAP Knowledge Base Article - Public

3362128 - How do I update a custom table through a REST API patch request?

Symptom

When using this patch request: PATCH​/api​/custom-table​/v1​/customTables​/{tableName} you may face this issue where when you pass an API call to update an existing custom table, it is not working as expected and the patch request creates a new custom table instead of updating it.

Environment

SAP SALES CLOUD CPQ

Cause

You may have missed to mention the keyword "keys" inside the context with column name.

Resolution

You should mention keyword "Keys" inside the context of the body while passing this patch request - PATCH​/api​/custom-table​/v1​/customTables​/{tableName}  

In addition, if you wish to update multiple columns at the same time, you can mention two primary column names.
For example, if you wish to update the value based on the state and city, you can mention multiple state and city names inside the keys.

Example:

{
  "context": {
    "Keys": [
      "one",
      "two"
    ]
  },
  "value": [
    {
    "one": "testone",
    "two":"testtwo",
    "Three":"IN"
    
    }
  ]
 
 

"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."

See Also

Swagger UI (webcomcpq.com)

Custom Table API | SAP Help Portal

Keywords

patch request, update custom table, Patch REST API, keys , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , How To

Product

SAP CPQ 2020