Static input fields
Actions/Triggers in plugins require an input form because they always need a way for users to send data to your app’s API to find, update, or create a new object. Syntax to create static type fields through JSON are as follow:
string :
[ { "key": "username", "type": "string", "label": "username", "help": "help text", "placeholder": "enter text", "required": true } ] |
|
![](https://storage.googleapis.com/kb-frontend-prod/static/342616/Kb17181786195228891718178614403.png)
|
number:
[ { "key": "phone", "type": "number", "label": "Contact No", "help": "help text", "placeholder": "+91-xxxxxxxxx", "required": true } ] |
|
![](https://storage.googleapis.com/kb-frontend-prod/static/342616/Kb17181773224058041718177314204.png)
|
boolean:
[ { "key": "send_mail", "type": "boolean", "label": "Send notification", "help": "help text", "required": true } ] |
|
![](https://storage.googleapis.com/kb-frontend-prod/static/342616/Kb17181773240876131718177314047.png)
|
Default value
[ { "key": "send_mail", "type": "boolean", "label": "Send notification", "help": "help text", "required": true } ] |
![](https://storage.googleapis.com/kb-frontend-prod/static/342616/Kb17181773210880021718177314013.png)
Static input group:
[ { "key": "enter_key_here", "type": "input groups", "label": "label here", "help": "help text here", "required": true, "children": [ { "key": "enter_key_here1", "label": "label here1", "placeholder": "placeholder here1", "type": "string", "help": "help text here", "required": true }, { "key": "enter_key_here2", "type": "dropdown", "label": "label here", "placeholder": "placeholder here1", "help": "help text here", "required": true, "children": [] } ] } ]
|
|
![](https://storage.googleapis.com/kb-frontend-prod/static/342616/Kb1718177325790671718177314349.png)
|
Static dropdown:
[ { "key": "enter_key_here", "type": "dropdown", "label": "label here", "help": "help text here", "required": true, "children": [ { "label": "label here1", "sample": "sample text here1", "value": "value here1" }, { "label": "label here2", "sample": "sample text here2", "value": "value here2" } ] } ] |
|
![](https://storage.googleapis.com/kb-frontend-prod/static/342616/Kb17181773152499981718177313711.png)
|
We can also send default value in any of the field
When designing APIs or building user interfaces that interact with APIs, it's crucial to inform users about default values, especially if these defaults may impact the behavior of the system or the data processing. User can edit this default value
For string/number/boolean
[ { "key": "username", "help": "help text", "type": "string", "label": "username", "required": true, "placeholder": "enter text", "defaultValue": "IN" } ] |
|
![](https://storage.googleapis.com/kb-frontend-prod/static/342616/Kb1718177319454691718177314274.png)
|
For dropdown
[ { "key": "enter_key_here", "type": "dropdown", "label": "label here", "help": "help text here", "defaultValue": { "label": "default", "value": "default value" }, "children": [ { "label": "label here1", "sample": "sample text here1", "value": "value here1" }, { "label": "label here2", "sample": "sample text here2", "value": "value here2" } ] } ] |
|
![](https://storage.googleapis.com/kb-frontend-prod/static/342616/Kb17181781475521861718178146237.png)
|