{
  "title": "Customer Testimonial Form",
  "description": "We'd love to share your story. Tell us about your experience and choose how you'd like your testimonial to appear.",
  "showQuestionNumbers": "off",
  "questionErrorLocation": "bottom",
  "completeText": "Submit testimonial",
  "widthMode": "static",
  "width": "760px",
  "elements": [
    {
      "type": "text",
      "name": "fullName",
      "title": "Full name",
      "isRequired": true,
      "autocomplete": "name"
    },
    {
      "type": "text",
      "name": "email",
      "title": "Email",
      "description": "Used only to confirm your testimonial before publication.",
      "isRequired": true,
      "startWithNewLine": false,
      "inputType": "email",
      "autocomplete": "email",
      "validators": [
        { "type": "email" }
      ]
    },
    {
      "type": "text",
      "name": "jobTitle",
      "title": "Job title",
      "maxLength": 100
    },
    {
      "type": "text",
      "name": "companyName",
      "title": "Company",
      "startWithNewLine": false,
      "autocomplete": "organization"
    },
    {
      "type": "text",
      "name": "companyWebsite",
      "title": "Company website",
      "placeholder": "https://",
      "inputType": "url"
    },
    {
      "type": "dropdown",
      "name": "productUsed",
      "title": "Which product is your testimonial about?",
      "isRequired": true,
      "choices": [
        { "value": "form-builder", "text": "Form Builder" },
        { "value": "analytics", "text": "Analytics Dashboard" },
        { "value": "pdf-export", "text": "PDF Export" },
        { "value": "platform", "text": "The whole platform" }
      ]
    },
    {
      "type": "radiogroup",
      "name": "usageDuration",
      "title": "How long have you used it?",
      "colCount": 4,
      "choices": [
        { "value": "under-3-months", "text": "Less than 3 months" },
        { "value": "3-12-months", "text": "3–12 months" },
        { "value": "1-3-years", "text": "1–3 years" },
        { "value": "over-3-years", "text": "More than 3 years" }
      ]
    },
    {
      "type": "rating",
      "name": "overallRating",
      "title": "Overall, how would you rate your experience?",
      "isRequired": true,
      "rateType": "stars",
      "rateMin": 1,
      "rateMax": 5,
      "minRateDescription": "Poor",
      "maxRateDescription": "Excellent"
    },
    {
      "type": "comment",
      "name": "testimonialText",
      "title": "Your testimonial",
      "description": "What problem were you trying to solve, how did the product help, and what results have you seen? Two to five sentences is ideal.",
      "isRequired": true,
      "rows": 6,
      "maxLength": 1000
    },
    {
      "type": "checkbox",
      "name": "keyBenefits",
      "title": "Which benefits stood out most?",
      "colCount": 2,
      "choices": [
        { "value": "time-savings", "text": "Saved time" },
        { "value": "cost-savings", "text": "Reduced costs" },
        { "value": "ease-of-use", "text": "Easy to use" },
        { "value": "customer-support", "text": "Great customer support" },
        { "value": "integrations", "text": "Integrates with our tools" },
        { "value": "reliability", "text": "Reliable and stable" }
      ],
      "showOtherItem": true,
      "otherText": "Something else"
    },
    {
      "type": "text",
      "name": "favouriteFeature",
      "title": "Favourite feature",
      "maxLength": 150
    },
    {
      "type": "radiogroup",
      "name": "publishPermission",
      "title": "How may we publish your testimonial?",
      "isRequired": true,
      "choices": [
        { "value": "full-name-company", "text": "Publish with my full name, title, and company" },
        { "value": "first-name-only", "text": "Publish with my first name only" },
        { "value": "anonymous", "text": "Publish anonymously" },
        { "value": "internal-only", "text": "Do not publish – for internal use only" }
      ]
    },
    {
      "type": "file",
      "name": "photoUpload",
      "visibleIf": "{publishPermission} anyof ['full-name-company', 'first-name-only']",
      "title": "Your photo",
      "description": "Optional. A headshot makes testimonials more personal. JPG or PNG, up to 5 MB.",
      "acceptedTypes": "image/*",
      "maxSize": 5242880
    },
    {
      "type": "boolean",
      "name": "logoPermission",
      "visibleIf": "{publishPermission} = 'full-name-company'",
      "title": "May we display your company logo alongside your testimonial?",
      "labelTrue": "Yes",
      "labelFalse": "No"
    },
    {
      "type": "boolean",
      "name": "contactForCaseStudy",
      "title": "Would you be open to a short interview for a case study?",
      "labelTrue": "Yes",
      "labelFalse": "No"
    }
  ],
  "completedHtml": "<h3>Thank you, {fullName}!</h3><p>We truly appreciate you sharing your experience with <b>{productUsed}</b>. If we plan to publish your testimonial, we'll send the final text to <b>{email}</b> for your approval first.</p>",
  "completedHtmlOnCondition": [
    {
      "expression": "{publishPermission} = 'internal-only'",
      "html": "<h3>Thank you, {fullName}!</h3><p>Your feedback about <b>{productUsed}</b> will be shared with our team only and won't be published anywhere. We appreciate you taking the time.</p>"
    }
  ]
}
