Examples menu

Examples / Fill in forms

Human answers take priority

If the person changes a field and then rewrites their request, the AI updates its own answers but leaves the person's changes alone.

Agent Input, part of the UAG's browser library @formio/uag-js, fills the form from what the person writes in Describe your request, and fills it again whenever they rewrite it. Each time, it updates only the fields it filled itself and the ones still empty. A field the person typed in, picked or corrected belongs to them: it is never overwritten, and the AI does not answer it again.

The same holds when the AI is unsure and offers options (see Leave unsure answers to the person): once the person picks one, it is theirs.

Try it: pick the first sample, change the Name field, then pick the second sample. The email, topic and subject change to match the new text; the name stays as you typed it.

Turn it on

json
{
  "title": "Example: Human answers take priority",
  "name": "exampleHumanAnswersPriority",
  "path": "example-human-answers-priority",
  "type": "form",
  "display": "form",
  "tags": [
    "uag"
  ],
  "properties": {
    "description": "A general request: who sent it, how to reach them, and what it is about."
  },
  "components": [
    {
      "type": "textarea",
      "key": "description",
      "label": "Describe your request",
      "input": true,
      "placeholder": "Tell us what you need, in your own words.",
      "rows": 4,
      "validate": {
        "required": true
      },
      "properties": {
        "uag": "fill",
        "uagField": "input"
      }
    },
    {
      "type": "textfield",
      "key": "name",
      "label": "Name",
      "input": true,
      "properties": {
        "uag": "fill"
      }
    },
    {
      "type": "email",
      "key": "email",
      "label": "Email",
      "input": true,
      "properties": {
        "uag": "fill"
      }
    },
    {
      "type": "select",
      "key": "topic",
      "label": "Topic",
      "input": true,
      "dataSrc": "values",
      "data": {
        "values": [
          {
            "label": "Question",
            "value": "question"
          },
          {
            "label": "Problem",
            "value": "problem"
          },
          {
            "label": "Request",
            "value": "request"
          },
          {
            "label": "Feedback",
            "value": "feedback"
          }
        ]
      },
      "properties": {
        "uag": "fill"
      }
    },
    {
      "type": "textfield",
      "key": "subject",
      "label": "Subject",
      "input": true,
      "properties": {
        "uag": "fill"
      }
    },
    {
      "type": "button",
      "key": "submit",
      "label": "Submit",
      "action": "submit",
      "input": true
    }
  ]
}

Try it

Samples:
Example: Human answers take priority

Read about it in the developer docs