Start a new topic
Answered

Nullify an attribute via REST APIs

How can I nullify an attribute when publishing data to Semarchy via REST APIs?


Best Answer

To set a populated string value to null, you can use empty double-quotes.

In this example, I have set attribute ManufSupplier which previously contained a value, to null

"persistRecords": {    "Material": [    {    "MaterialID": "888-222-A",         "MaterialDescription": "Peter's Test Material Rec",         "PackSize": "Large",         "FID_MaterialGroup": "U02",         "ManufSupplier": "",         "SalesVATClass": "5",         "PurchasingTax": "H",         "ProfitCentre": "1234554321"      }      

And this is the response (partial)

   "PurchasingTax": "H",          "CopiedFrom": null,          "ManufSupplier": null        }

 

1 Comment

Answer

To set a populated string value to null, you can use empty double-quotes.

In this example, I have set attribute ManufSupplier which previously contained a value, to null

"persistRecords": {    "Material": [    {    "MaterialID": "888-222-A",         "MaterialDescription": "Peter's Test Material Rec",         "PackSize": "Large",         "FID_MaterialGroup": "U02",         "ManufSupplier": "",         "SalesVATClass": "5",         "PurchasingTax": "H",         "ProfitCentre": "1234554321"      }      

And this is the response (partial)

   "PurchasingTax": "H",          "CopiedFrom": null,          "ManufSupplier": null        }

 

Login to post a comment