Cohort Feedback: change the questions and add your own
How to rename the questions on a Cohort Feedback form, hide the optional ones, and add up to 20 of your own, with settings you can copy and a check you can run before you publish.
Everything on the form comes from one block of settings, FORM_CONFIG, written as JSON. You never edit the form itself: change the settings, publish them, and the form, the owner view and the CSV all follow.
Each step below has settings you can copy. Run the check at the end before you publish.
1. Start from the basics
A form needs a title and at least one product: the things people can review. Pages are optional; they become a "Which part?" list.
{
"title": "How was the workshop?",
"intro": "Two minutes, and it shapes the next one.",
"privacy": "Answers are kept to improve the workshop and are never sold or shared.",
"privacy_url": "https://example.com/privacy#feedback",
"products": [
{ "id": "day1", "label": "Day 1", "pages": [{ "id": "talks", "label": "Talks" }, { "id": "labs", "label": "Labs" }] },
{ "id": "day2", "label": "Day 2" }
]
}
privacy_url is optional. When set, the consent line ends with a Privacy notice link.
2. Rename a question
Add questions with the new wording. You can rename these seven:
| Key | Asks by default |
|---|---|
role |
Who are you? |
product |
What did you review? |
rating |
How did you find it? |
liked |
What worked well? |
change |
What should change? |
device |
You used it on |
quote |
Can we quote this as a testimonial? |
"questions": {
"rating": "How would you rate it overall?",
"liked": "Best part?"
}
3. Hide the optional questions
device, liked and change are optional, so you can hide them. The rating, product and consent always stay.
"hide": ["device"]
4. Add your own questions
Add a fields list. Each question needs an id, a label and a type.
id: 2 to 31 lowercase letters, numbers or_, starting with a letter, for examplefound_us. It names the CSV column (x_found_us), so keep it once answers come in.label: the question, as people will read it.type: one of the six below.
type |
People see | Extra settings |
|---|---|---|
text |
One line, up to 120 characters | |
long |
A text box, up to 2,000 characters | |
choice |
Buttons, one answer | options: the answers to pick from |
yesno |
Yes or No | |
scale |
1 to 5 | scale_labels: five words; leave any as "" |
number |
A number | min and max |
Any question can also have:
"required": true: the form won't send until it's answered."hint": "…": a short line under the question."products": ["day1"]: ask it only when that product is chosen.
"fields": [
{ "id": "found_us", "label": "How did you hear about it?", "type": "choice",
"options": ["A friend", "LinkedIn", "Search", "Other"], "required": true },
{ "id": "pace", "label": "Was the pace right?", "type": "scale",
"scale_labels": ["Too slow", "", "Just right", "", "Too fast"] },
{ "id": "again", "label": "Would you come again?", "type": "yesno" },
{ "id": "team_size", "label": "Team size", "type": "number", "min": 1, "max": 500, "hint": "Rough is fine." },
{ "id": "day2_topic", "label": "A topic you want on day 2", "type": "text", "products": ["day1"] }
]
You can have up to 20. They appear after the built-in questions, before the testimonial question.
5. Send people to the right product
Add ?product= and, if you like, &page= to the form's address, using your ids. The form opens with them chosen:
https://feedback.example.com/?product=day1&page=labs
6. Check your settings before you publish
Paste your settings between the backticks and run this in your browser's console (right-click the page, Inspect, Console), or save it as check.js and run node check.js. It changes nothing; it only tells you what to fix.
// Paste your settings between the backticks, then run this in your browser's
// console (or save it as check.js and run: node check.js).
const settings = `
{
"title": "How was the workshop?",
"products": [{ "id": "day1", "label": "Day 1" }, { "id": "day2", "label": "Day 2" }],
"fields": [
{ "id": "found_us", "label": "How did you hear about it?", "type": "choice", "options": ["A friend", "LinkedIn"], "required": true }
]
}`;
const TYPES = ["text", "long", "choice", "yesno", "scale", "number"];
const QUESTIONS = ["role", "product", "rating", "liked", "change", "device", "quote"];
const problems = [];
let c;
try { c = JSON.parse(settings); } catch (e) { problems.push("Not valid JSON: " + e.message); }
if (c) {
if (!Array.isArray(c.products) || !c.products.length) problems.push("Add at least one product.");
const productIds = (c.products || []).map((p) => p.id);
for (const k of Object.keys(c.questions || {})) if (!QUESTIONS.includes(k)) problems.push(`questions.${k}: not a question you can rename.`);
for (const h of c.hide || []) if (!["device", "liked", "change"].includes(h)) problems.push(`hide: "${h}" can't be hidden.`);
const seen = new Set();
(c.fields || []).forEach((f, i) => {
const at = `fields[${i}]${f && f.id ? ` (${f.id})` : ""}`;
if (!f || !/^[a-z][a-z0-9_]{1,30}$/.test(f.id)) problems.push(`${at}: id must be 2 to 31 lowercase letters, numbers or _, starting with a letter.`);
else if (seen.has(f.id)) problems.push(`${at}: the same id is used twice.`); else seen.add(f.id);
if (!f || !f.label) problems.push(`${at}: add a label.`);
if (!f || !TYPES.includes(f.type)) problems.push(`${at}: type must be one of ${TYPES.join(", ")}.`);
if (f && f.type === "choice" && !(Array.isArray(f.options) && f.options.length)) problems.push(`${at}: a choice needs options.`);
if (f && f.type === "scale" && f.scale_labels && f.scale_labels.length !== 5) problems.push(`${at}: scale_labels needs exactly five entries.`);
for (const p of (f && f.products) || []) if (!productIds.includes(p)) problems.push(`${at}: product "${p}" isn't in products.`);
});
if ((c.fields || []).length > 20) problems.push("Up to 20 questions of your own; the rest are ignored.");
}
console.log(problems.length ? "Fix these:\n- " + problems.join("\n- ") : `Looks good: ${(c.fields || []).length} question(s) of your own, ${c.products.length} product(s).`);
7. Publish
Put the checked settings into FORM_CONFIG and publish, the same way you set the form up the first time (the README has the steps). Open the form to see your questions, then send one test answer.
Where the answers go
- Owner view: under each response, every answer to your own questions, with its label.
- CSV: one column per question, named
x_plus its id, after the built-in columns. - Changing your mind: if you remove a question, answers already given are kept. If you rename its label, the answers stay with it; if you change its
id, it counts as a new question.
Common mistakes
| You see | Fix |
|---|---|
| A question doesn't show | Check its id (lowercase, starts with a letter), that type is one of the six, and that a choice has options. Run the check in step 6. |
| It shows for one product only | Remove products, or add the other product's id to it. |
| "Choose an answer." won't go away | The question is required. Answer it, or remove required. |
| The whole form shows defaults | The settings aren't valid JSON, so the form falls back. Run the check in step 6. |
Want documentation like this for your product?