FAQ
Developer hub
Plugin Input Fields

Plugin Input Fields


Input fields are elements in a user interface (UI) where users can enter data. They are fundamental components of forms, allowing users to provide information such as text, numbers, dates, and selections. Each input field is designed to capture a specific type of data, ensuring that the information entered by the user can be processed correctly by the application. Also Click here., for instructions on adding input fields in JSON when creating a plugin and action.

📌

AI Field
​The AI Field enables you to integrate AI-powered capabilities into your app's triggers and actions. By adding this field type, you can allow your users to leverage AI for complex tasks without requiring manual intervention.




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: 

Static Input Fields
Static input fields are predefined and do not change based on user interactions. They are essential components in forms and user interfaces for collecting and displaying specific types of data. Here's an overview of different static input field types and their functions: 

String
​A string input field collects text data, such as names, addresses, and email addresses. For example, a field labeled "Name" might guide users with an initial value like "John Doe."

Number
A number input field collects numerical data, ideal for ages, quantities, or prices. It ensures users enter valid numbers and can enforce constraints like minimum and maximum values.

Boolean
Boolean input fields capture binary choices (true/false, yes/no) using checkboxes or toggles. They are useful for preferences like agreeing to terms or subscribing to newsletters.

Static Dropdown
Static dropdown fields provide a fixed list of options, ensuring consistent data entry. They are ideal for selections like country or status, offering users a predefined list to choose from.

Input Group
Input groups are collections of related input fields under one label, useful for capturing complex data like addresses or contact information. They help organize related data, making forms more user-friendly.

Default
The default value sets the initial content of an input field, providing users with a hint or example of the expected input. This improves form usability and ensures data consistency.

Click here. to know more about static input fields. 
Click here. for instructions on adding input fields in JSON when creating a plugin and action.

Static input fields
May 15, 2025

Useful in scenarios where users need to select multiple items, such as tags, categories, or preferences in such cases enables users to make multiple selections from a set of options. So this is an array with a comma-separated list of entries sent in the API request. Do not ask users to type this manually  use the built-in functionality instead.

Advanced Input Fields

Advanced input fields enhance the user experience by offering more functionality and flexibility in data collection. They address specific needs beyond basic input fields, improving data accuracy and usability. Here are some key types of advanced input fields:

Dynamic Dropdown
A dropdown menu is a UI element that displays a list of options when clicked. Users can select a single value from here. Children here are dynamically fetched via a source. The source here is a JavaScript code that runs and gives the dynamic option. Here is the data type to render dropdown fields in the plugin. Check source section to for more details on source.

Dynamic Multiselect
A multiselect is a tool that lets you pick multiple options from a list at the same time. Children here are dynamically fetched via a source. The source here is a JavaScript code that runs and gives the dynamic option. Here is the data type to render multiselect fields in the plugin. Check source section to for more details on source.

Hidden Fields
This field type is used to hide other fields based on value selected from its children, the key fieldsToHide will have a mapping of children key corresponding to which other keys of the parent json will be hidden on that children being selected.

Help Text
Help text provides additional instructions or examples near input fields, reducing user confusion and errors. It ensures users understand how to complete each field correctly, improving the overall user experience.

Dictionary 
It helps you organize and store information using pairs of related data. Each pair consists of a unique key and a value. In this data type, we define the keys and values template. This template allows the user to define the datatype of individual input fields.

Dynamic Input Groups
Dynamic input groups allow users to add or remove sets of related input fields as needed. This feature enhances flexibility by letting users modify the form structure, such as adding multiple phone numbers or email addresses dynamically.

​To know more about adding these input fields in any action or trigger, Click here.

This document provides an extensive explanation of creating dynamic input fields for plugins. For knowing the Json structure of all these fields go to their corresponding pages.

Dynamic multiselect
Apr 30, 2025

A dynamic input group is a set of input fields that can be added, removed, or modified in real-time based on user interactions or API response . This feature allows for the creation of optional fields and can hide them when not in use, providing flexibility and enhancing user experience.

📌For example When creating a new record in an airtable, dynamically fetch and display columns inside an input group. Users can then input data only into the columns they need, making the process efficient and user-friendly using following steps and achieve result :




  • Take a get API for get all columns from airtable API documentation

  • Configure it in javascript API call code 

  • Return an array containing a object containing key,label,type,help for columns 

  • unchecked

    key is used to access this specific column value ex: ${context.inputData.inputgroupName.coloumnName}

  • uncheckedLabel shown on the UI

  • unchecked

    type decide type of the field using if condition in input group source code you can change type for a field also

  • uncheckedhelp text can be static or dynamic. Handle source code


const response = await axios({

            url:         `https://api.airtable.com/v0/meta/bases/${context.inputData.basesList}/tables`,

            method: 'GET',

            headers: {

               Authorization: `Bearer ${context.authData.accesstokencode.access_token}`

            }

        });

        const tables = response.data.tables;


let fields = [];

for(let i = 0 ;i < selectedTableList.length ; i++)

{

    let json = {

    "key": selectedTableList[i].name,

    "label":  selectedTableList[i].name,

    "type": "string",

     "help": selectedTableList[i].type, 

    "required": false,

    "list": false,

    "altersDynamicFields": false

  } 

  fields.push(json)

}

return fields;





[

{

    "key": "fieldlist",

    "type": "input groups",

    "label": "fieldlist",

    "source": "const response = await axios({\r\n            url: `https://api.airtable.com/v0/meta/bases/${context.inputData.basesList}/tables`,\r\n            method: 'GET',\r\n            headers: {\r\n                Authorization: `Bearer ${context.authData.accesstokencode.access_token}`\r\n            }\r\n        });\r\n        const tables = response.data.tables;\r\nlet selectedTableList ;\r\nfor(let i = 0 ;i < tables.length ; i++)\r\n{\r\n  if(tables[i].id===`${context.inputData.tablesList}`)\r\n            selectedTableList=tables[i]?.fields\r\n   \r\n}\r\nlet fields = [];\r\nfor(let i = 0 ;i < selectedTableList.length ; i++)\r\n{\r\n    let json = {\r\n    \"key\": selectedTableList[i].name,\r\n    \"label\":  selectedTableList[i].name,\r\n    \"type\": \"string\",\r\n     \"help\": selectedTableList[i].type, \r\n    \"required\": false,\r\n    \"list\": false,\r\n    \"altersDynamicFields\": false\r\n  } \r\n  fields.push(json)\r\n}\r\nreturn fields;",

    "required": true,

    "dependsOn": [

      "tablesList"

    ]

  }


]


Response : 

it returns a key-value pair. If the key for the column is "name", the returned value will be in the format {site: "site_id"}. To use this value, the path is ${context.inputData.inputgroupName.coloumnName}: 



Dynamic Input group
Apr 30, 2025


A dynamic dropdown updates its options in real-time based on user interactions or API. The values are fetched from an API using a JavaScript call, and the data is displayed as an array of objects, each containing a label, sample, and value. (Dropdown allows only single value to select)

The source API includes a JavaScript call to fetch the required data. Once retrieved, the data is shown in the dropdown as an array of objects, each containing a label, sample, and value for the child options. Example  : If you want to create sites dropdown for webflow application so this is what you have to integrate :


  • Take a get API for get all sites from webflow API documentation

  • Configure it in javascript API call code 

  • Return a object containing label,sample,value for all sites 

const testApiUrl = 'https://api.webflow.com/v2/sites';
const response = await axios.get(testApiUrl, {
  headers: {
    "Authorization"`Bearer ${context.authData.accesstokencode.access_token}`,
    "accept" : "application/json"
  }
});
const array = response.data.sites.map(subs => ({
  label: subs.displayName,
  value: subs.id,

  sample: subs.id
}));
return array;

[

  {

    "key": "site",

    "type": "dropdown",

    "label": "Select site",

  "source": "const testApiUrl = 'https://baseurl/endpoint;\r\nconst   response = await axios.get(testApiUrl,{\r\nheaders:{\r\n\"Authorization\":`Bearer ${context.authData.___}`,\r\n\"accept\":\"application/json\"\r\n }\r\n});\r\nconst array = response.data.sites.map(subs => ({\r\n  label: subs.displayName,\r\n  value: subs.id\r\n}));\r\nreturn array;",

    "required": true

  }

]

Response : 

On selecting a value from the dropdown, it returns a key-value pair. If the key for sites is "site", the returned value will be in the format {site: "site_id"}. To use this value, the path is ${context.inputData.site} : 

Dynamic dropdown
Apr 30, 2025


Dynamic help text is a contextual help popup shown to users based on specific conditions handled in the source code. When these conditions occur, the help text provides guidance to help users understand the plugin's behavior. In short dynamic help text provides real-time feedback based on user interactions. 

📌For example, if you're creating an action for Google Sheets to create a new entry, you can use dynamic help text to alert the user if the selected sheet has no columns, making it easy for the user to understand and debug the issue.

  • Take a get API for get all columns of sheet(example) from google API documentation

  • Configure it in javascript API call code 

  • Return an array containing label,key,type,help etc  for all column, with this add a condition in code if condition not fulfilled return empty array in children and message


const apiUrl = `https://sheets.googleapis.com/v4/spreadsheets/${context.inputData.spreadSheet_id}/values:batchGet?ranges=${context.inputData.sheet_id}!1:1000&valueRenderOption=UNFORMATTED_VALUE

 const headers = { Authorization: `Bearer ${context.authData.accesstokencode.access_token}` };


  const response = await axios.get(apiUrl, { headers: headers })

     let arrToReturn=[]

   if(response.data?.valueRanges?.[0]?.values?.[0]){ 

         

             const obj = { key: entry, label: entry, type: 'string', required: false, help: ' ' }

             arrToReturn.push(obj) 

             }

//when no columns found

else{

         arrToReturn = {

         children: [],

         message: "Didn't see any headers in the provided spreadsheet!\n\n Did you  
 add headers to the spreadsheet? If so, just refresh this step to pull in the new data.\n\n
[Click here for instructions on setting up your spreadsheet.](https://viasocket.com/faq)"

                 }

             } 

return arrToReturn 


Dynamic Help Text
Apr 30, 2025
The "Hidden" feature in form or JSON configurations is indeed used to control the visibility of specific fields based on certain conditions or selections. Consider a scenario where you have a form with a dropdown menu allowing users to select a file type: "Image", "PDF", or "Text". Depending on the selection, only the relevant fields for that file type are displayed.

🔴Note : Hidden Fields does not support dynamic API calls for children.

Hidden Fields: Use the “hidefields”type to make fields invisible while passing necessary data.

Conditional Hidden Fields: Use “fieldsToHide”to hide fields based on conditions from other fields.

Dropdown Children: Condition applicable on dropdown children. If nothing is selected in the dropdown all the fields are visible to the user.

[

  { 

    "key": "FileType",

    "type": "hidefields",

    "label": "FileType",

    "children": [

      {

        "label": "attachment",

        "value": "attachment",

        "sample": "attachment"

      },

      {

        "label": "image",

        "value": "image",

        "sample": "image"

      },

      {

        "label": "file",

        "value": "file",

        "sample": "file"

      }

    ],

    "fieldsToHide": {

      "file": [

        "image",

        "attachment"

      ],

      "image": [

        "attachment",

        "file"

      ],

      "attachment": [

        "image",

        "file"

      ]

    }

  },

  {

    "key": "image",

    "type": "string",

    "label": "image"

  },

  {

    "key": "file",

    "type": "string",

    "label": "file"

  },

  {

    "key": "attachment",

    "type": "string",

    "label": "attachment"

  }

]

Show fields based on selected field:





    

Hidden Fields
Apr 30, 2025

The AI Field in viaSocket Plugin Builder enables you to integrate AI-powered capabilities into your app's triggers and actions. By adding this field type, you can allow your users to leverage AI for complex tasks without requiring manual intervention.

How to Use the AI Field

When building a plugin in viaSocket, you can include an AI Field to enhance your app’s automation capabilities. This field type helps automate decision-making, text generation, data extraction, and other AI-supported functions, making integrations smarter and more efficient.

JSON Configuration for AI Field

To add an AI Field to your plugin, use the following JSON structure:

{
    "key": "XfDxOeon",
    "type": "aifield",
    "label": "Sample Label",
    "help": "Enter help text",
    "required": true,
    "prompt": "Write a prompt to define the AI's behavior, task, or role.",
    "suggestionGenerator": " // Enter JS code as the source from which AI will generate results"
}

Explanation of JSON Fields

  • key: A unique identifier for the AI field.

  • type: Specifies the field type as aifield.

  • label: The display name of the field.

  • help: Instructional text to guide users on how to use this field.

  • required: Defines whether this field is mandatory.

  • prompt: Defines the AI's behavior, task, or role in generating responses.

  • suggestionGenerator: Specifies the source of data from which the AI will generate results.

Benefits for SaaS Developers and Plugin Builders

  • Enhanced automation: Leverage AI to automate complex tasks within your app integration.

  • User-friendly experiences: Reduce the need for manual inputs by providing AI-powered suggestions.

  • Customizable AI responses: Define AI behavior through structured prompts and dynamic data inputs.

  • Seamless integration: Improve your app's functionality with AI-driven decision-making and processing.

Use Cases and Examples

Below are some direct JSON examples you can copy and paste into your viaSocket plugin:

1. Smart Email Categorization

{
    "key": "email_category",
    "type": "aifield",
    "label": "Email Category",
    "help": "Classify the email content into Sales, Support, or Feedback.",
    "required": true,
    "prompt": "Classify this email into one of the following categories: Sales, Support, or Feedback.",
    "suggestionGenerator": "return input.email_content;"
}

2. Automated Social Media Caption Generator

{
    "key": "social_caption",
    "type": "aifield",
    "label": "Generate Social Media Caption",
    "help": "Create an engaging caption for social media posts.",
    "required": true,
    "prompt": "Generate a creative Instagram caption for a new product launch.",
    "suggestionGenerator": "return input.product_name + ' ' + input.product_description;"
}

3. Customer Sentiment Analysis

{
    "key": "sentiment_analysis",
    "type": "aifield",
    "label": "Customer Sentiment",
    "help": "Analyze the sentiment of customer feedback.",
    "required": true,
    "prompt": "Analyze the sentiment of this customer review and provide a one-word summary.",
    "suggestionGenerator": "return input.customer_review;"
}

4. Resume Screening in HR Applications

{
    "key": "resume_score",
    "type": "aifield",
    "label": "Resume Screening Score",
    "help": "Evaluate resumes and suggest suitability for a role.",
    "required": true,
    "prompt": "Assess this resume and provide a suitability score (0-100) for the position of Software Engineer.",
    "suggestionGenerator": "return input.resume_text;"
}

5. Automated Data Enrichment

{
    "key": "data_enrichment",
    "type": "aifield",
    "label": "Enrich Lead Data",
    "help": "Fill missing company details based on partial contact information.",
    "required": true,
    "prompt": "Find and fill missing company details (industry, size, location) for this contact.",
    "suggestionGenerator": "return input.company_name;"
}

By integrating the AI Field in your viaSocket plugin, you can enhance your app’s automation capabilities, providing smarter and more powerful workflows for your users.

AI Field
Apr 30, 2025

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. When building a plugin action or trigger on the Platform viaSocket, use the JSON or GUI to create the user input form for your app's API. 

JSON (JavaScript Object Notation) : When building a plugin, JSON is used to define the structure and behavior of forms that users interact with.

Screenshot 2025-05-16 at 3.47.22 PM.png

In the Form editor, add in details about your input field:

 

  1. Key: A unique identifier used to reference a specific item, object, or field in a system.

  2. Value: The data or information associated with a specific key or field.

  3. Help: Information or instructions provided to assist the user in understanding or using a feature.

  4. Type: Specifies the data type or format expected for a given field or value (e.g., string, number, boolean).

  5. Required: Indicates that a field must be filled or a value must be provided for the process to continue.

  6. optionsGenerator: A function or method that dynamically generates a list of options for a given field based on certain conditions or logic.

  7. Fields: Individual elements or components in a form or system that collect or display data (e.g., text boxes, checkboxes).

  8. List: A collection or array of items, typically displayed in a sequential or organized format.

  9. Placeholder: Text or value displayed in a form field as a hint or example of what information is expected.

  10. VisibilityCondition: A rule or condition that determines whether a particular field or element is visible to the user.

  11. customInputLabel: A custom label or text displayed beside an input field, describing what data the user should enter.

  12. customPlaceholder: A customized placeholder text that provides more specific guidance or information in a form field.

  13. defaultValue: The initial value that a field or input element will have before the user interacts with it.

Input Builder
May 16, 2025
Prev