Single-line Input Type : File Upload
The file upload field in Cliq forms allows you to attach upto a maximum of 10 files. Take a look at the list of attributes passed for this input field type is given below. All mandatory attributes are indicated with a * and the maximum characters allowed is provided with the Data Type.
Attribute Name | Data Type & Limit | Description |
type* | string Value should be file | The type of single line text input field. |
placeholder* | string (100) | Sample field value displayed to the user that describes the expected value of the input field. |
name* | string (50) | A unique identifier for the field. On form submission, the value defined for this key will be available in the function associated with the form. |
label* | string (50) | Describes the field display name. |
hint* | string (100) | Provides a brief description of the field's purpose and the expected input. |
mandatory | boolean | Define if the field's requisite is mandatory or not. Default value considered is true. |
multiple | boolean | Define if your field should be a single select or multi select field. For all multi select fields, multiple should be set as true. |
max_selections | integer Maximum selections allowed: 10 | Defines the number of options that a user can choose from the drop-down. Note: Value for this field defaults to 1 in case of single select drop-downs. |
max_size | integer Value should be in KB ranging from 1- 51200. | Defines the maximum file size limit for files to be uploaded |
Syntax
{
"hint": "",
"name": "",
"label": "",
"placeholder": "",
"type": "file",
"mandatory": true, //boolean, default value is set as true
"multiple": true, //boolean, default value is set as true
"max_selections": ""
}
Code Sample
return {
"type":"form",
"title":"Event Registration",
"name":"survey",
"hint":"Please fill out your details to register for the event",
"button_label":"Upload",
"inputs":[
{
"label":"Participant Photo",
"name":"file",
"placeholder":"Please upload a photo for your runner's ID.",
"mandatory":true,
"type":"file"
}
],
"action":{
"type":"invoke.function",
"name":"function"
}
};