{
  "form": {
    "archived": false,
    "list_view_fields": [],
    "public": false,
    "access": "Private",
    "connections": [],
    "created_by": {
      "id": "6230635087cd9e8f340ad2be",
      "first_name": "Deepak",
      "last_name": "Bhatt"
    },
    "name": "Site Inspection Smart Suggestion",
    "page_count": 1,
    "current_page": 0,
    "deployed": true,
    "created_at": "2026-06-12T08:46:38.637Z",
    "pages": [
      {
        "components": [
          {
            "repeat_value": [],
            "components": [],
            "controlling_elements": [],
            "type": "Voice_Agent",
            "name": "Voice Agent",
            "category": "other",
            "label": "Voice Assistant",
            "icon": "https://d3iyvxaud7i110.cloudfront.net/apps/builder/elements/voice_agent.png",
            "attributes": {
              "read_text_from_field": "b7c1-4e2a-9d3f",
              "ai_prefill_component_id": "6f50-ed54-a541",
              "voice_agent_welcome_message": "Hello, I am your inspection assistant. Tap Start Speaking and tell me the inspection details, or ask me what information the form needs and what the rules are. I will fill in and check the fields for you.",
              "start_button_label": "Start Speaking",
              "stop_button_label": "Stop",
              "voice_language": "en-US",
              "voice_name": ""
            },
            "component_id": "dd1a-382b-a8ec",
            "required": false
          },
          {
            "repeat_value": [],
            "components": [],
            "controlling_elements": [],
            "type": "Hidden",
            "value": "",
            "name": "Hidden",
            "category": "input",
            "label": "AI Voice Response",
            "icon": "/scripts/formbuilder/img/hidden.png",
            "component_id": "b7c1-4e2a-9d3f",
            "attributes": {
              "enable_merge_fields": false,
              "trim_hidden_field_value": false,
              "enable_advanced_templating": false,
              "reset_value_on_new_repeat_entry": false
            },
            "required": false
          },
          {
            "repeat_value": [],
            "components": [],
            "controlling_elements": [],
            "type": "Hidden",
            "value": "You are a friendly voice assistant inside a form. You help the user fill the form hands-free.\n\nYou will receive a form configuration as JSON. It defines every field: its key, label, type, allowed values or format, validation rules with error messages, and smart_suggestion hints.\n\nProcess each user message against that configuration:\n0. If the user asks a question about the form itself, for example what fields exist, what the rules or validations are, what values are allowed, or how to fill out the form, answer that question in agent_response using the configuration in plain spoken language, and leave all field keys unchanged. Only when the user is providing information should you extract values.\n1. Extract values for any configured fields mentioned in the conversation.\n2. Apply each field's smart_suggestion hints to normalise the value, for example resolving dates, mapping speech to allowed_values, or inferring values from other fields.\n3. Before filling any value, check it against the field's validations. If a value violates a rule, leave that key as an empty string, explain using the rule's message, and suggest a valid alternative in agent_response.\n4. Track which fields with a required validation are still empty and ask for them in agent_response, one or two at a time.\n5. Once all required fields hold valid values, confirm them back to the user and say the form is ready to submit.\n\nRespond ONLY with a raw JSON object, no markdown, no code fences and no explanation, containing exactly the keys listed in output_keys. Every field key holds the extracted valid value or an empty string. agent_response is a short natural spoken reply of at most two sentences that will be read aloud, worded slightly differently each time so it is never identical to your previous reply.",
            "name": "Hidden",
            "category": "input",
            "label": "AI Engine Prompt",
            "icon": "/scripts/formbuilder/img/hidden.png",
            "component_id": "c9e2-5f3b-a1d4",
            "attributes": {
              "enable_merge_fields": false,
              "trim_hidden_field_value": false,
              "enable_advanced_templating": false,
              "reset_value_on_new_repeat_entry": false
            },
            "required": false
          },
          {
            "repeat_value": [],
            "components": [],
            "controlling_elements": [],
            "type": "Hidden",
            "value": "{\"form\":\"Site Inspection\",\"output_keys\":[\"inspector_name\",\"inspector_email\",\"contact_phone\",\"inspection_date\",\"inspection_status\",\"meter_reading\",\"inspection_notes\",\"agent_response\"],\"fields\":[{\"key\":\"inspector_name\",\"label\":\"Inspector Name\",\"type\":\"text\",\"validations\":[{\"validation\":\"data-parsley-required\",\"value\":\"true\",\"message\":\"Inspector name is required.\"},{\"validation\":\"data-parsley-minlength\",\"value\":\"3\",\"message\":\"Inspector name must be at least 3 characters.\"}],\"smart_suggestion\":{\"normalize\":\"Full name in title case.\",\"infer\":\"If the user says 'me' or 'myself', ask for their name once and reuse it.\"}},{\"key\":\"inspection_date\",\"label\":\"Inspection Date\",\"type\":\"date\",\"format\":\"YYYY-MM-DD\",\"validations\":[{\"validation\":\"data-parsley-required\",\"value\":\"true\",\"message\":\"Please enter the inspection date.\"}],\"smart_suggestion\":{\"normalize\":\"Resolve relative dates like 'today', 'tomorrow' or 'next Thursday' to YYYY-MM-DD using the current date.\",\"default\":\"If the user implies the inspection is happening now, suggest today's date and confirm.\"}},{\"key\":\"inspection_status\",\"label\":\"Inspection Status\",\"type\":\"select\",\"allowed_values\":[\"Pass\",\"Fail\",\"Needs Follow-up\"],\"validations\":[{\"validation\":\"data-parsley-required\",\"value\":\"true\",\"message\":\"Please select an inspection status.\"}],\"smart_suggestion\":{\"normalize\":\"Map free speech to the closest allowed value, e.g. 'failed' -> 'Fail', 'all good' -> 'Pass', 'check again later' -> 'Needs Follow-up'.\",\"infer\":\"If meter_reading is above 90000, suggest 'Needs Follow-up' and ask the user to confirm before filling.\"}},{\"key\":\"meter_reading\",\"label\":\"Meter Reading\",\"type\":\"number\",\"validations\":[{\"validation\":\"data-parsley-required\",\"value\":\"true\",\"message\":\"Meter reading is required.\"},{\"validation\":\"data-parsley-min\",\"value\":\"0\",\"message\":\"Meter reading cannot be negative.\"},{\"validation\":\"data-parsley-max\",\"value\":\"100000\",\"message\":\"Meter reading cannot exceed 100,000.\"}],\"smart_suggestion\":{\"normalize\":\"Digits only, no units or thousands separators.\",\"on_invalid\":\"If the spoken value breaks a rule, do not fill it. Quote the rule message, suggest the nearest plausible valid value if one is obvious, and ask the user to confirm.\"}},{\"key\":\"inspector_email\",\"label\":\"Inspector Email\",\"type\":\"email\",\"validations\":[{\"validation\":\"data-parsley-required\",\"value\":\"true\",\"message\":\"Inspector email is required.\"},{\"validation\":\"data-parsley-type\",\"value\":\"email\",\"message\":\"Please enter a valid email address.\"}],\"smart_suggestion\":{\"normalize\":\"Convert spoken email to standard format, e.g. 'deepak at formyoula dot com' -> 'deepak@formyoula.com', lowercase.\",\"on_invalid\":\"If it does not look like a valid email, read it back and ask the user to confirm or correct it.\"}},{\"key\":\"contact_phone\",\"label\":\"Contact Phone\",\"type\":\"phone\",\"validations\":[{\"validation\":\"data-parsley-pattern\",\"value\":\"^[0-9+()\\\\-\\\\s]{7,15}$\",\"message\":\"Phone must be 7-15 digits, may include + ( ) -.\"}],\"smart_suggestion\":{\"normalize\":\"Digits only with optional leading +, convert spoken numbers like 'double seven' to '77'.\",\"optional\":\"This field is optional, do not chase the user for it. Only fill it if mentioned.\"}},{\"key\":\"inspection_notes\",\"label\":\"Inspection Notes\",\"type\":\"textarea\",\"validations\":[{\"validation\":\"data-parsley-maxlength\",\"value\":\"250\",\"message\":\"Notes cannot exceed 250 characters.\"}],\"smart_suggestion\":{\"normalize\":\"Summarise any observations, issues or remarks the user mentions into a short note of at most 250 characters.\",\"optional\":\"This field is optional, do not chase the user for it.\"}}]}",
            "name": "Hidden",
            "category": "input",
            "label": "Field Validation & Suggestion Config",
            "icon": "/scripts/formbuilder/img/hidden.png",
            "component_id": "d2f7-8a1c-e5b6",
            "attributes": {
              "enable_merge_fields": false,
              "trim_hidden_field_value": false,
              "enable_advanced_templating": false,
              "reset_value_on_new_repeat_entry": false
            },
            "required": false
          },
          {
            "repeat_value": [],
            "components": [],
            "controlling_elements": [],
            "type": "AI_Prefill",
            "name": "AI Prefill",
            "category": "media",
            "label": "Prefill Form Fields Through AI Prompt",
            "icon": "https://d3iyvxaud7i110.cloudfront.net/apps/builder/elements/ai_prefill.png",
            "version": "1",
            "attributes": {
              "prefill_mappings": [
                {
                  "form_field": "a045-6bc0-f02c",
                  "object_field": "inspector_name",
                  "default_value": ""
                },
                {
                  "form_field": "3f9b-f2cb-bc67",
                  "object_field": "inspection_date",
                  "default_value": ""
                },
                {
                  "form_field": "effd-4735-fdf9",
                  "object_field": "inspection_status",
                  "default_value": ""
                },
                {
                  "form_field": "46dc-7a99-8baa",
                  "object_field": "meter_reading",
                  "default_value": ""
                },
                {
                  "form_field": "e1a2-3b4c-5d6e",
                  "object_field": "inspector_email",
                  "default_value": ""
                },
                {
                  "form_field": "f7a8-9b0c-1d2e",
                  "object_field": "contact_phone",
                  "default_value": ""
                },
                {
                  "form_field": "a3b4-5c6d-7e8f",
                  "object_field": "inspection_notes",
                  "default_value": ""
                },
                {
                  "form_field": "b7c1-4e2a-9d3f",
                  "object_field": "agent_response",
                  "default_value": ""
                }
              ],
              "ai_prompt": "{{c9e2-5f3b-a1d4}}\n\nForm configuration as JSON:\n{{d2f7-8a1c-e5b6}}\n\nConversation so far as a JSON array, where type user is the person speaking and type assistant is you:\n{{dd1a-382b-a8ec}}",
              "repeat_prefill_field_id": "",
              "select_photo_fields": "",
              "disable_empty_field_prefill": true
            },
            "component_id": "6f50-ed54-a541",
            "required": false
          },
          {
            "repeat_value": [],
            "components": [],
            "controlling_elements": [],
            "type": "Text",
            "name": "Text",
            "category": "input",
            "label": "Inspector Name",
            "icon": "/scripts/formbuilder/img/text.png",
            "attributes": {
              "guide_url": "https://support.formyoula.com/guides/text-field"
            },
            "component_id": "a045-6bc0-f02c",
            "required": false
          },
          {
            "repeat_value": [],
            "components": [],
            "controlling_elements": [],
            "type": "Date",
            "name": "Date",
            "category": "input",
            "label": "Inspection Date",
            "icon": "/scripts/formbuilder/img/date.png",
            "component_id": "3f9b-f2cb-bc67",
            "required": false
          },
          {
            "repeat_value": [],
            "components": [],
            "controlling_elements": [],
            "type": "Select",
            "name": "Select",
            "category": "select",
            "label": "Inspection Status",
            "icon": "/scripts/formbuilder/img/select.png",
            "select_options": "Pass\nFail\nNeeds Follow-up",
            "component_id": "effd-4735-fdf9",
            "required": false
          },
          {
            "repeat_value": [],
            "components": [],
            "controlling_elements": [],
            "type": "Number",
            "name": "Number",
            "category": "input",
            "label": "Meter Reading",
            "icon": "/scripts/formbuilder/img/number.png",
            "component_id": "46dc-7a99-8baa",
            "required": false
          },
          {
            "repeat_value": [],
            "components": [],
            "controlling_elements": [],
            "type": "Email",
            "name": "Email",
            "category": "input",
            "label": "Inspector Email",
            "icon": "/scripts/formbuilder/img/email.png",
            "component_id": "e1a2-3b4c-5d6e",
            "required": false
          },
          {
            "repeat_value": [],
            "components": [],
            "controlling_elements": [],
            "type": "Phone",
            "name": "Phone",
            "category": "input",
            "label": "Contact Phone",
            "icon": "/scripts/formbuilder/img/Phone.png",
            "component_id": "f7a8-9b0c-1d2e",
            "required": false
          },
          {
            "repeat_value": [],
            "components": [],
            "controlling_elements": [],
            "type": "TextArea",
            "name": "TextArea",
            "category": "input",
            "label": "Inspection Notes",
            "icon": "/scripts/formbuilder/img/text_area.png",
            "component_id": "a3b4-5c6d-7e8f",
            "required": false,
            "height": "3",
            "attributes": {
              "show_label": "Yes"
            }
          }
        ],
        "page_id": "7b29-5a90-e9d4",
        "title": "Details",
        "page_index": 1,
        "component_count": 20,
        "deployed": true
      }
    ],
    "owner_id": "6230635087cd9e8f340ad2be",
    "created_by_id": "6230635087cd9e8f340ad2be",
    "attributes": {}
  },
  "connections": []
}