SynapseOrch 2.0 is a release candidate; the stable release is 1.9.3. How to try 2.0

Collect Data

The collect data tool puts a form in front of the user during a chat, so an agent can gather structured information before it carries on with a task.

Tool: collect_data

Returns a form definition. It does not wait for the user and returns no answers itself: the Chat screen sees the definition, shows the form, and when the user submits it, their answers arrive as the next user message in the conversation.

Arguments

ArgumentTypeDescription
fieldsarrayThe fields to show (required)

Field definition

PropertyTypeRequiredDescription
labelstringYesThe question shown to the user
typestringYestext, number, email, date, phone or options
optionsarray of stringsFor optionsThe choices, shown as buttons
multiplebooleanNoAllow several choices (options only)

There is no field name, title, placeholder or required flag. Answers are identified by their label, so give each field a distinct one.

Use cases

Before I run the report, I need to collect some parameters from you.
Please fill in your project details so I can set up the repository.
I need a few details to book the meeting. Let me show you a form.

Example

{
  "tool": "collect_data",
  "arguments": {
    "fields": [
      {
        "label": "Date Range",
        "type": "options",
        "options": ["last_7_days", "last_30_days", "last_quarter"]
      },
      { "label": "Send report to", "type": "email" },
      {
        "label": "Include charts?",
        "type": "options",
        "options": ["yes", "no"]
      }
    ]
  }
}

The user sees the form in Chat. After they submit it, the agent receives a plain-text message with each label and answer:

Date Range: last_30_days, Send report to: alice@example.com, Include charts?: yes

With a single field, the message is just the answer. Several choices from a multiple field are joined with commas.

Where the form appears

Only the Chat screen renders the form. Through the API, a messaging channel or a chat widget there is no form — the caller just sees the agent's reply. Use it for agents people talk to in Chat.

Integration with workflows

In a workflow, use a Human step to collect input partway through a run — the run pauses, is checkpointed, and resumes when someone answers. Use collect_data for lightweight, in-conversation data gathering in Chat.

On this page