PUT /ws/rest/service/v1/ds/data-elements
Version: 20.10
Purpose:
To update custom data elements
Input:
All parameters should be URL encoded.
Both input & output in JSON format in the body
Update Data Element input JSON
{
"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"
}
]
}
Input JSON field description:
- Required Fields:
Data_element(Required): specify the existing date element name
- Non-required Fields:
- Description
- Tooltip
- Valid Fields based on the data_definition value:
data_definition | Required Field Name (Existing values will be used if there are no values in the request body) |
---|---|
Image Picker | height (required) |
SYS Rich Text | height (required) |
textarea (as data_source) | no_of_lines (required) |
Decimal Amount | decimal_format (not required - default value is '8') |
SYS Numeric Query Based | hide_currency_symbol (not required - valid values are Yes/No - default value will be No) |
Notes:
- data_element field value will be used to uniquely identify the existing Data Element.
- Field values can be cleared by providing the empty string in the input request.
- data_definition and form_lable values cannot be emptied/cleared and if no values are provided in the request then already existing values will be taken.
- data_definition field value of a DE cannot be updated if that DE is pre-defined or already deployed.
- For all the fields mentioned above, if no values are provided in the input request then existing values of the given data element will be taken.
Output:
JSON object containing 'status', 'data', 'message'
Update Data Element ouptut JSON
{
"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
}
Status codes are:
1> 200, for success
2> 3000, for partial create.
3> 3002, for invalid JSON input
4> 1101, for Empty or Invalid JSON data