rest task-forms save-form dropdown

cancel
Showing results for 
Search instead for 
Did you mean: 
kdevineni1
Active Member

rest task-forms save-form dropdown

Jump to solution

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.

1 Solution

Accepted Solutions
sanjaybandhniya
Intermediate

Re: rest task-forms save-form dropdown

Jump to solution

Hi,

You need to provide id and name of option.

Ex.

{
  "values": {
     "firstName" : "test1",
     "lastName"  : "Test3",
      "country": 
    	{
    		"id": "India", 
    		"name": "India"
    		
    	}
   }
}

View solution in original post

4 Replies
sanjaybandhniya
Intermediate

Re: rest task-forms save-form dropdown

Jump to solution

Hi,

You need to provide id and name of option.

Ex.

{
  "values": {
     "firstName" : "test1",
     "lastName"  : "Test3",
      "country": 
    	{
    		"id": "India", 
    		"name": "India"
    		
    	}
   }
}
EddieMay
Alfresco Employee

Re: rest task-forms save-form dropdown

Jump to solution

Hi @kdevineni1 & welcome to Alfresco,

Thanks for accepting the solution - helpful to others who have a similar issue.

Take care,

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!
kdevineni1
Active Member

Re: rest task-forms save-form dropdown

Jump to solution

Thank you @sanjaybandhniya

 Is there any document or link explaining the json formats for the different types of form controls 

kdevineni1
Active Member

Re: rest task-forms save-form dropdown

Jump to solution

Whats the format for saving the hyperlink.

 

I need to update the hyperlink variable from rest call.