form

  • To embed the form inside the widget to perform more additional actions based on the visitor's requirements.
  • It is one of the return types of the action handler. If there is a need to collect data from the person accessing the widget (i.e, operators in SalesIQ), this return type can be used. The data collected in the form will be controlled by the form controllers. Learn more.

ParameterDescriptionDatatypeMax Limit
nameName of the form. This will be passed to form controller handlers.String 
actionDetails of the action that was performed. Inside this action, the type should be "invoke.function" and the name should be the name of the form controller whose handlers are to be invoked during the form actions.  
typeType of action that has to be performed - formString-
hint Hint that will be displayed in the form near the form titleString-
trigger_on_cancelWhether to invoke the form's submit handler when the form is cancelled without submissionString50
inputsList of inputs to be displayed in the form to collect dataList 25
mandatory Boolean 
placeholder String 
button_label If the "Submit" text of the form is to be replaced with a custom text, this can be usedString 
titleThe title of the form that is displayed in the form's headerString 
pendingThe pending action is valid for 3 minutes. ie, the callback API for a particular pending action should be invoked within 3 minutes. Learn more.Boolean-

Sample Script (Deluge):

else if("form".equals(buttonName))
{
	response.put("type","form");
	response.put("title","All inputs form");
	response.put("name","widgetform");
	response.put("action",{"type":"invoke.function","name":"sargunam"});
	response.put("hint","This form contains all the input types available");
	response.put("button_label","Submit");
	response.put("trigger_on_cancel",true);
	/*Add inputs*/
	inputs = Collection();
	checkBox = {"type":"checkbox","name":"checkbox","label":"Select the required features from the following","hint":"You can select upto two","value":"bots","mandatory":false,"trigger_on_change":true,"options":{{"label":"Zobot","value":"bots"},{"label":"Widgets","value":"widgets"},{"label":"Form Controllers","value":"forms"},{"label":"Webhooks","value":"webhooks"}},"max_selections":2};
	date = {"type":"date","name":"date","label":"Select a date","placeholder":"Place holder 100","hint":"This input will not work, need fix","mandatory":false,"value":"2020-05-30"};
	dateTime = {"type":"datetime","name":"datetime","label":"Select a date and time from the calendar","placeholder":"placeholder 100","hint":"This is similar to zobot calendar widget","mandatory":false};
	dynamicSelect = {"type":"dynamic_select","name":"dynamic_select","label":"This input populates leads from CRM dynamically","hint":"Values will be listed based on the input from the user","placeholder":"Type anything","mandatory":false,"multiple":true,"options":{{"label":"Default value 1","value":"value1"},{"label":"Default value 2","value":"value2"},{"label":"Default value 3","value":"value3"},{"label":"Default value 4","value":"value4"},{"label":"Default value 5","value":"value5"}},"value":"value2","auto_search_min_results":5,"min_characters":3,"max_selections":2};
	email = {"type":"email","name":"email","label":"Enter your email address","placeholder":"Type your email here","hint":"Only email values will be accepted","value":"sargunam@zoho.com","mandatory":false,"min_length":10};
	// 	email = {"type":"email","name":"email","label":"Email address","placeholder":"jack@mail.com","hint":"enter a valid email","value":"value260@mail.com","mandatory":false};
	file = {"type":"file","name":"file","label":"Upload files","placeholder":"Placeholder","hint":"This is yet to be supported","mandatory":true,"multiple":true,"max_selections":3};
	hidden = {"type":"hidden","name":"hidden","value":"hidden value 1000"};
	// 	location = {"type":"location","name":"location","label":"Select a location","placeholder":"placeholder","hint":"This is yet to be supported","mandatory":true,"value":{"latitude":"20.3","longitude":"80.23"},"boundary":{"latitude":"34.5","longitude":"56.8","radius":100}};
	location = {"type":"location","name":"location","label":"Select a location","placeholder":"placeholder","hint":"This is yet to be supported","mandatory":true};
	// 	number = {"type":"number","name":"number","label":"label 50","placeholder":"placeholder 100","hint":"hint 100","mandatory":true};
	number = {"type":"number","name":"number","label":"Enter a number","placeholder":"Type a number","hint":"Only numeric values are accepted","mandatory":true,"max":200,"min":20,"value":3};
	// 	password = {"type":"password","name":"password","label":"label 50","placeholder":"placeholder 100","hint":"hint 100","mandatory":true,"value":"demo@123"};
	password = {"type":"password","name":"password","label":"Enter your password","placeholder":"Type ur password here","hint":"Whatever typed will be hidden","mandatory":true,"value":"demo@123","min_length":5};
	radio = {"type":"radio","name":"radio","label":"Select any one of the following","hint":"You can select only one here","mandatory":false,"trigger_on_change":true,"value":"value1","options":{{"label":"Zobot","value":"bots"},{"label":"Widgets","value":"widgets"},{"label":"Form Controllers","value":"forms"},{"label":"Webhooks","value":"webhooks"}}};
	select = {"type":"select","name":"select","label":"Select from the dropdown","placeholder":"placeholder 100","hint":"You can select multiple values max 2","mandatory":true,"trigger_on_change":true,"multiple":true,"options":{{"label":"Zobot - For bot chats","value":"bots"},{"label":"Widgets - For custom informations","value":"widgets"},{"label":"Form Controllers - For controlling forms","value":"forms"},{"label":"Webhooks - To be notified on events","value":"webhooks"}},"max_selections":2,"value":"forms"};
	tel = {"type":"tel","name":"tel","label":"Enter your phone number","placeholder":"Type phone number","hint":"Only phone number format values are accepted","value":"8883169888","mandatory":false,"min_length":10};
	// 	tel = {"type":"tel","name":"tel","label":"label 50","placeholder":"placeholder 100","hint":"hint 100","value":"value 100","mandatory":false};
	text = {"type":"text","name":"text","label":"Type something","placeholder":"Enter your text here","hint":"Min length is 1, max length is 10","value":"value 260","mandatory":false,"min_length":1,"max_length":10};
	// 	text = {"type":"text","name":"text","label":"label 50","placeholder":"placeholder 100","hint":"hint 100","value":"value 260","mandatory":false};
	textArea = {"type":"textarea","name":"textarea","label":"Type something here","placeholder":"Enter your larger texts here","hint":"This will support larger texts","value":"Action handler will handle the actions that triggered from detail widget cards. In this section, you will get to develop and deploy Zobots. You can either choose to develop Zobots using Zoho's own platform or using third-party integrations that we support.","mandatory":false,"min_length":10};
	// 	textArea = {"type":"textarea","name":"textarea","label":"label 50","placeholder":"placeholder 100","hint":"hint 100","value":"value 1000","mandatory":false};
	// 	url = {"type":"url","name":"url","label":"label 50","placeholder":"placeholder 100","hint":"hint 100","value":"value 2048","mandatory":false};
	url = {"type":"url","name":"url","label":"Enter your website link","placeholder":"Your link here","hint":"This field can be used to fetch url from user","value":"https://www.zoho.com/salesiq","mandatory":false,"min_length":10};
	inputs.add(date);
	inputs.add(checkBox);
	inputs.add(dateTime);
	inputs.add(dynamicSelect);
	// inputs.add(file);
	inputs.add(email);
	// 	// TODO
	inputs.add(hidden);
	inputs.add(location);
	inputs.add(number);
	inputs.add(password);
	// 	inputs.add(radio);
	inputs.add(tel);
	inputs.add(text);
	inputs.add(textArea);
	inputs.add(url);
	inputs.add(select);
	/**/
	info inputs;
	response.put("inputs",inputs);
}