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

  }

]







number: 


[

{

    "key": "phone",

    "type": "number",

    "label": "Contact No",

    "help": "help text",

    "placeholder": "+91-xxxxxxxxx",

    "required": true

  }

]



boolean: 


[

{

    "key": "send_mail",

    "type": "boolean",

    "label": "Send notification",

    "help": "help text",

    "required": true

  }

]




Default value 



[

{

    "key": "send_mail",

    "type": "boolean",

    "label": "Send notification",

    "help": "help text",

    "required": true

  }

]



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": []

      }

    ]

  }

]




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"

      }

    ]

  }

]



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"

  }

]






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"

      }

    ]

  }

]