viaSocket Help

Dictionary Field

#

What is a Dictionary Field?

A Dictionary Field is used when you need to send multiple key-value pairs in a workflow.

It is commonly used for:

  • custom fields,

  • metadata,

  • attributes,

  • extra properties,

  • or dynamic API data.

Simple flow:

User adds keys and values → The data is sent as an object in the workflow


#

What is a Key-Value pair?

A Dictionary Field works using:

  • Key → Field name

  • Value → Field value

Example:

Key

Value

first_name

Nishit

company

Walkover

city

Indore

This gets sent in the workflow like this:

{
  "first_name": "Nishit",
  "company": "Walkover",
  "city": "Indore"
}

#

When to use a Dictionary Field?

Use a Dictionary Field when:

  • the API expects object data,

  • users need to add custom fields,

  • field names may change dynamically,

  • or multiple values need to be grouped together.

Good examples:

Use Case

Example

Custom Fields

CRM custom properties

Metadata

Additional workflow information

Product Attributes

Color, size, category

Dynamic Properties

User-defined values

Extra API Data

Additional payload fields


#

How to add a Dictionary Field?

#

Step 1 - Open the Action

Open the action where you want to add the field.

#

Step 2 - Click “ADD FIELD”

Inside the Action Builder, go to the right-side panel and click on the ADD FIELD dropdown.

#

Step 3 - Select “Dictionary”

Choose Dictionary from the list of available field types.

#

Step 4 - Configure the Field

Fill in the field details:

Property

Value

Example

Type

dictionary

dictionary

Label

Field name (what the users see)

Custom Fields

Key

API parameter name (what the API reads)

custom_fields

Required

Makes the field mandatory

Yes / No

Help

Text displayed on hover for user guidance (Optional)

Enter the custom fields in key-value pairs

Visibility Condition

Hide/show field based on some condition

context?.inputData?.type === "crm"

Template

Defines the structure and placeholders for dictionary keys and values

Key Placeholder: Enter key
Value Placeholder: Enter value

[
  {
    "key": "custom_fields",
    "type": "dictionary",
    "label": "Custom Fields",
    "help": "Enter the custom fields in key-value pairs",
    "required": true,
    "template": {
      "key": {
        "type": "string",
        "placeholder": "Enter key"
      },
      "value": {
        "type": "string",
        "placeholder": "Enter value"
      }
    }
  }
]
#

Step 5 - Save the Field

Click anywhere outside the field settings panel to automatically save the field.


#

Configuration Example

Here’s a simple Dictionary Field setup:

Label

Key

Custom Fields

custom_fields

Metadata

metadata

Attributes

attributes

Example workflow data:

{
  "custom_fields": {
    "city": "Indore",
    "company": "Walkover",
    "source": "Website"
  }
}

#

Best Practices & Recommendations

  • Use Dictionary Field for dynamic or flexible data

  • Match keys with the API field names whenever possible

  • Use lowercase keys with underscores for better consistency

  • Check the API documentation before adding custom keys

  • Keep keys short and meaningful

Good key examples:

  • first_name

  • company_name

  • customer_type

  • custom_fields

Avoid keys like:

  • First Name

  • My Field

  • Company Name


#

Key Takeaways

Use a Dictionary Field when your workflow needs to send multiple dynamic key-value pairs.

It helps:

  • support flexible API structures,

  • send custom fields,

  • and handle dynamic workflow data more efficiently.