02-06-2021 01:31 PM
I am new to this forms, playing around.
My task form has drop down control (form control snippet)
{
"fieldType": "RestFieldRepresentation",
"id": "dropOffLocation",
"name": "",
"type": "dropdown",
"value": "Choose one...",
"required": false,
"readOnly": false,
"overrideId": true,
"colspan": 1,
"placeholder": null,
"minLength": 0,
"maxLength": 0,
"minValue": null,
"maxValue": null,
"regexPattern": null,
"optionType": "manual",
"hasEmptyValue": true,
"options": [
{
"id": "empty",
"name": "Choose one..."
},
{
"id": "option_1",
"name": "New York"
},
{
"id": "option_2",
"name": "New Jersey"
}
],
"restUrl": null,
"restResponsePath": null,
"restIdProperty": null,
"restLabelProperty": null,
"tab": null,
"className": null,
"params": {
"existingColspan": 1,
"maxColspan": 1
},
"dateDisplayFormat": null,
"layout": {
"row": -1,
"column": -1,
"colspan": 1
},
"sizeX": 1,
"sizeY": 1,
"row": -1,
"col": -1,
"visibilityCondition": null,
"endpoint": null,
"requestHeaders": null
}Using rest api I am trying to set the value for the dropdown.
api/enterprise/task-forms/:taskId/save-form
{
"values": {
"firstName" : "test1",
"lastName" : "Test3",
"dropOffLocation" : "option_1"
}
}I was able to set the text field values(firstName and lastName, but not the dropdown(select) values.
What would be format for setting the dropdown values ?
Thanks in advance.
02-09-2021 07:56 AM
Hi,
You need to provide id and name of option.
Ex.
{
"values": {
"firstName" : "test1",
"lastName" : "Test3",
"country":
{
"id": "India",
"name": "India"
}
}
}
02-09-2021 07:56 AM
Hi,
You need to provide id and name of option.
Ex.
{
"values": {
"firstName" : "test1",
"lastName" : "Test3",
"country":
{
"id": "India",
"name": "India"
}
}
}
02-10-2021 06:24 AM
Thank you @sanjaybandhniya
Is there any document or link explaining the json formats for the different types of form controls
02-26-2021 11:56 AM
Whats the format for saving the hyperlink.
I need to update the hyperlink variable from rest call.
02-10-2021 06:18 AM
Hi @kdevineni1 & welcome to Alfresco,
Thanks for accepting the solution - helpful to others who have a similar issue.
Take care,
Explore our Alfresco products with the links below. Use labels to filter content by product module.