Update Data Element

PUT /ws/rest/service/v1/ds/data-elements

Version: 20.10

Purpose

Update custom data elements.

Request Format

All parameters should be URL encoded.

Both input & output in JSON format in the body

Request Parameters

The following parameters can be included in the request:

Request Parameter Required? Description
data_element Yes The name of the existing data element.
Description No  
Tooltip No  

Valid Fields Based on the data_definition Value

Specify the following data element field that has the corresponding data_definition value below. Existing values are used if there are no values in the request body.

Data Element Field Required? data_definition Value
height Yes Image Picker
height Yes SYS Rich Text
no_of_lines Yes textarea (as data_source)

decimal_format

Default value is '8'.

No Decimal Amount

hide_currency_symbol

Valid values are Yes, and No (default).

No SYS Numeric Query Based

Note:

  • data_element field value is used to uniquely identify existing data elements.
  • Specify an empty string in the request to clear field values.
  • data_definition and form_label values cannot be emptied/cleared. If no values are provided in the request, existing values are used.
  • data_definition field value of a DE cannot be updated if that DE is pre-defined or already deployed.
  • If no values are provided in the request for the above fields, existing values of the given data element are used.

Response Format

A JSON object is returned in the following format:

{

"data": [],

"message": [],

"status": <REST status code value>

}

A successful response displays a status code 200.

A failed response displays a message with a status code.

Sample Request

This is an example of a request to update the data element SampleDE and SampleImgDE.

{

"data": [

{

"data_element": "sampleDE",

"data_definition": "SYS Rich Text",

"form_label": "Sample Rich Text Element",

"description": "Test DE",

"height": "50"

},

{

"data_element": "sampleImgDE",

"data_definition": "Image Picker",

"form_label": "Sample Image Picker",

"description": "Test Image DE",

"tooltip": "Test Image DE"

}

]

}

Sample Response

This is an example of a partially successful response for two data elements listed below.

{

"data": [

{

"data_element": "sampleDE",

"data_definition": "SYS Rich Text",

"form_label": "Sample Rich Text Element",

"description": "Test DE",

"tooltip": null,

"height": "50" ,

"Pre-Defined Category": null

}

],

"message": [

{

"data_element": "sampleDE",

"message": "success"

},

{

"data_element": "sampleImgDE",

"message": "sampleImgDE does not exists",

"status": 505

}

],

"status": 3000

}

Supported Validation Messages and Status Codes

The following status codes and messages can display in the response to a request.

Status Code Validation Message
200 Success
1101 Empty or Invalid JSON data
3000 Partial create
3002 Invalid JSON input