FAQ
Developer hub
Plugin Input Fields

Plugin Input Fields


Input Fields are UI elements that let users provide data when using your plugin or action in viaSocket. These fields appear in the workflow builder and capture values like:

  • ✏️ Text (e.g., name, email)

  • 🔢 Numbers (e.g., quantity, amount)

  • 📅 Dates (e.g., deadline, birthdate)

  • ✅ Options (e.g., dropdowns, checkboxes)

Each field is tailored to a specific data type, ensuring your plugin receives and processes the right kind of information.


Why They Matter

Input fields make your plugins dynamic and customizable.
For example, a “Send Email” action might include:

  • To: email address

  • Subject: text input

  • Message: long text box

These fields allow users to configure the plugin per use case—without editing code.


Behind the Scenes

When you create a plugin or action, you define these input fields using JSON. Each field has:

  • A key (used in your code, like context.inputData.email)

  • A type (e.g., string, number, date, select)

  • A label (visible to the user)

  • Optional rules: required, placeholder, default value, etc.

📌

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 and Triggers in plugins require input fields so users can send data to your API—like creating, updating, or searching for a record. These fields are defined in JSON format and appear in the viaSocket UI when users build their workflows.


What Are Static Input Fields?

Static input fields are fixed fields that do not change based on user choices. They're predefined and useful when you know exactly what inputs are needed.

These help structure and validate the data users enter—improving accuracy and user experience.


Types of Static Input Fields

String

Collects plain text like names, email addresses, or labels.
Example: "Name" with a default like "John Doe"


Number

Accepts numeric values such as price, quantity, or age.
You can apply limits (min/max) to ensure valid input.


Boolean

Captures true/false or yes/no choices using toggles or checkboxes.
Ideal for things like "Subscribe?" or "Agree to Terms"


Static Dropdown

Shows a fixed list of options for users to pick from.
Great for fields like "Country", "Status", or "Priority"


Input Group

Groups multiple related fields under one label (e.g., address block).
Helps organize complex input like "Shipping Info" or "User Details"


Default Value

Sets a pre-filled value to guide users on expected input.
Helps with clarity and improves usability.


Where to Use This

  • In plugin Actions: Send user-entered data to external APIs

  • In Triggers: Accept filter values or settings for trigger logic

  • In forms: Display clean, user-friendly inputs for workflow setup


📘 For Instructions on Adding Fields via JSON:

Click here

Static input fields
Aug 1, 2025

When building powerful plugins, sometimes basic input types like text or number aren't enough. That's where Advanced Input Fields come in—they enhance form flexibility, adapt to user choices, and streamline complex data collection.


Why Use Advanced Input Fields?

These fields are especially useful for:

  • Multi-select options (like tags or categories)

  • Dynamically changing form options

  • User-guided input with help text

  • Organizing complex or repeated data


Key Types of Advanced Input Fields


Dynamic Dropdown

A dropdown where options are fetched dynamically using JavaScript.

  • Users select a single value

  • Options load from a script using the source key

  • Perfect for API-driven lists (e.g., selecting a contact or channel)

👉 The dropdown auto-renders based on your JavaScript source logic.


Dynamic Multiselect

A multi-select version of the dropdown—also powered by JavaScript.

  • Allows selecting multiple items

  • Great for choosing tags, categories, or multiple preferences

  • Returns an array (comma-separated) in the API request

🚫 Do not ask users to enter comma-separated values manually—this field handles it natively.


Hidden Fields

This smart field controls visibility of other fields.

  • Based on the selected value, it hides specified fields dynamically

  • Uses a fieldsToHide mapping in JSON

  • Ideal for conditional logic in your plugin forms


Help Text

Optional instructional text displayed alongside input fields.

  • Explains what data is expected

  • Reduces errors and improves clarity

  • Ideal for fields with special formatting or complex logic


Dictionary

Used to collect key-value pairs, like JSON objects.

  • You define templates for keys and values

  • Users can add multiple entries (e.g., {"type": "email", "value": "[email protected]"})

  • Ideal for headers, parameters, or field mappings


Dynamic Input Groups

Lets users add/remove groups of related fields.

  • Example: multiple phone numbers or social media links

  • Flexible and repeatable input structure

  • Each group can contain several field types


📘 To Learn How to Add Advanced Input Fields to Your Plugin:

Click here

Dynamic multiselect
Aug 1, 2025

Dynamic Help Text provides real-time feedback and contextual assistance to users—based on live conditions inside your plugin's code. It helps users understand what’s happening, especially when something goes wrong.

Rather than showing static instructions, dynamic help adapts to API responses, user inputs, or edge cases—making your plugin easier to debug and more intuitive to use.


Why Use It?

  • Guide users when something is misconfigured

  • Alert when required data (e.g., column headers) is missing

  • Help users resolve issues instantly

  • Enhance user experience with real-time suggestions


Example Use Case

Suppose you’re creating an action for Google Sheets to insert a new row. The plugin must know what columns exist—but if the selected sheet has no headers, you should notify the user immediately.


How It Works

You can fetch data using an API call, check a condition, and then return either:

  • A valid field structure

  • Or a message + empty fields when validation fails


Sample Code

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 });  let arrToReturn = [];  // ✅ If column headers are found if (response.data?.valueRanges?.[0]?.values?.[0]) {   const headers = response.data.valueRanges[0].values[0];   arrToReturn = headers.map(entry => ({     key: entry,     label: entry,     type: 'string',     required: false,     help: ''   })); }  // ❌ If no headers found else {   arrToReturn = {     children: [],     message: 😕 Didn't see any headers in the provided spreadsheet.  🛠 Did you add headers to the spreadsheet?   If so, refresh this step to pull in the new data.  🔗 [Click here for instructions on setting up your spreadsheet.](https://viasocket.com/faq)   }; }  return arrToReturn; 

How to Use in viaSocket

  • Add this code directly in the plugin builder's JavaScript API Call

  • Or embed it in JSON using the "source" key (make sure to escape the code using EscapeJSON before pasting)


Pro Tip

You can use this method in any plugin scenario—like:

  • Checking authentication validity

  • Verifying API credentials

  • Ensuring resources (e.g., project ID, table columns) exist

  • Alerting for unsupported settings

Dynamic Help Text
Aug 1, 2025

The Hidden Field feature lets you control which fields appear in the UI based on user selections. It’s perfect for creating clean, dynamic forms where users only see what’s relevant.

This is especially useful when you want to show or hide specific fields based on another field’s value—like a dropdown selection.


Why Use Hidden Fields?

  • Hide irrelevant fields to reduce clutter

  • Show only the fields needed for a specific selection

  • Pass hidden data silently without user input

  • Maintain flexible form logic with minimal user confusion


Important Notes

  • Hidden fields do not support dynamic API calls for children

  • You can use them with static dropdown options

  • Fields are controlled using the "fieldsToHide" logic


Example Scenario

Let’s say you have a dropdown called File Type with options:

  • Image

  • PDF

  • Text

Sample JSON Setup

[
  {
    "key": "FileType",
    "type": "hidefields",
    "label": "File Type",
    "options": [
      { "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 URL"
  },
  {
    "key": "file",
    "type": "string",
    "label": "File Path"
  },
  {
    "key": "attachment",
    "type": "string",
    "label": "Attachment Link"
  }
]

🔍 How It Works

  • User selects "image" in the dropdown
    → Only the image field is shown.

  • If "file" is selected
    → Only the file field is shown.

  • If nothing is selected
    → All fields are visible by default


💡 Pro Tips

  • Use this pattern to conditionally reveal config sections, upload fields, or advanced settings

  • Works best when paired with "type": "hidefields" and clearly defined fieldsToHide

  • Helpful in actions like file uploads, media classification, or multi-mode plugins


Show fields based on selected field:

image


image


image



    

Hidden Fields
Aug 1, 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
Jul 29, 2025

Every Action or Trigger in a viaSocket plugin requires an input form. These forms collect user data and pass it to your app’s API to create, update, find, or delete records.

You can create input forms using either:

  • GUI (Form Editor) – drag-and-drop input field builder

  • JSON Configuration – manually define field structure and behavior


Why JSON?

JSON (JavaScript Object Notation) is the foundation for defining the input field behavior and structure in your plugin. It allows for flexible configuration, dynamic rendering, and consistent data processing.

Screenshot 2025-05-16 at 3.47.22 PM.png

In the Form Editor, define the following field attributes:

Property

Description

Key

A unique identifier for the field

Value

The data submitted for that field

Help

Guidance text shown to help users understand the field

Type

Expected data type (string, number, boolean, etc.)

Required

If true, the field must be filled before proceeding

optionsGenerator

JS function to dynamically generate dropdown options

Fields

Nested fields or grouped input components

List

Used for array-style inputs (e.g., list of tags)

Placeholder

Hint text shown in the field before user input

VisibilityCondition

Rule that shows/hides the field based on other inputs

customInputLabel

Custom label shown alongside the field

customPlaceholder

Custom hint text shown inside the field

defaultValue

Initial value shown in the field before user makes changes


Example Use Case

If you're creating a trigger for a CRM plugin to “Find Deals by Stage,” your form might include:

  • A dropdown for “Deal Stage” (fetched via API)

  • A text field for “Minimum Deal Size”

  • A boolean checkbox for “Include Archived Deals?”

Input Builder
Aug 1, 2025