How to Build a Survey or Form App
A form builder looks simple until someone edits question 3 after 200 people answered it. Here is the data model, the logic and the results view that hold up.

Key takeaways
- Store questions as rows with a type and settings, and answers as rows linked to both the response and the question. That shape powers charts and exports.
- Keep skip logic to "if answer to X is Y, jump to section Z". Anything fancier becomes a programming language nobody can debug.
- Public forms need an insert-only rule: anyone can submit, only the owner can read.
To build a survey or form app, model each form as an ordered list of typed questions (short text, multiple choice, rating, date, file and so on), let respondents submit without an account through an insert-only rule on the responses table, save each answer as its own row tied to the question, and build a results page that charts choice questions and exports everything to CSV. Add simple skip logic between sections and you have covered what most people actually use in the big form tools.
One form, or a form builder?
This decision changes the size of the project by a factor of five, so make it first.
- A fixed form for one purpose: an intake questionnaire for a clinic, a feedback form after a workshop, a job application. Questions are known, so the agent can build them as real fields with real validation. Small, fast, polished.
- A form builder: you (or your users) create new surveys without touching code. Questions become data, every question type needs an editor and a renderer, and results must work for any form. This is the bigger build described in the rest of this guide.
Many teams who think they need a builder actually need three fixed forms. Count your real forms before choosing.
Question types worth supporting
Start with the types that cover nearly every survey, each with its own settings:
- Short text and long text: max length, placeholder.
- Single choice and multiple choice: options list, an optional "Other" with a text box, randomize order.
- Rating or scale: 1 to 5 or 0 to 10, with labels for each end ("Not likely", "Very likely"). This also covers Net Promoter style questions.
- Number: min, max, unit.
- Date: earliest and latest allowed.
- Email and phone: format checks.
- File upload: allowed types, max size, stored in a private bucket.
Matrix grids, ranking by drag and drop, signatures and payment questions can wait. Each new type means an editor, a renderer, validation, a results chart and an export format.
The data model
- forms: owner, title, description, status (draft, open, closed), close date, response limit, a slug for the public link, and a thank-you message.
- sections: form id, title, position. Sections are the unit that skip logic jumps between.
- questions: section id, position, type, prompt, help text, required flag, and a settings field holding the type-specific options.
- logic_rules: question id, operator (equals, includes, greater than), value, and target section id or "end".
- responses: form id, submitted at, completion time in seconds, and optionally the respondent's user id or email.
- answers: response id, question id, a copy of the question prompt as it was, and the value (text, number, or a list of chosen options).
Storing each answer as its own row, rather than one big blob per response, is what makes per-question charts and filters cheap. The copied prompt protects you when someone edits a question after responses arrive.
The hard part: editing a form that has answers
Someone will fix a typo in question 3 after 200 responses. Someone else will change "Which plan are you on? Basic / Pro" to "Basic / Pro / Team". Decide the rules up front:
- Wording changes are fine. Old answers keep their copied prompt; results show the current wording.
- Adding options is fine. Old responses simply never chose it.
- Removing or renaming options keeps old answers as they were, shown in results as "(removed option)".
- Changing a question's type after it has answers is blocked. Offer "duplicate as a new question" instead.
Skip logic that stays readable
Keep logic at the section level: after a section, look at the rules for its questions in order and jump to the first matching target, otherwise continue to the next section. That covers "If you answered No, skip to the end" and "Teachers go to section 3, students to section 4". Show the logic in the editor as plain sentences ("If Role is Teacher, go to Classroom questions"), and warn when a rule points backwards, since that can create a loop.
Letting strangers submit safely
A public survey has a tricky access shape: anyone can write, almost nobody can read. On Startbase Cloud every table gets row level security, and the policies for a public form look like this in plain words: anyone may insert a response and its answers for a form that is open; only the form's owner may read them. The Database docs show how those policies are edited.
Spam follows any public form. Validate on the server (required fields, types, lengths), add a hidden honeypot field bots fill in, and cap submissions per form per hour. For one-response-per-person surveys, require sign-in or send each person a unique link; checking IP addresses blocks whole offices and schools sharing a network.
Results people can act on
- 01Summary tab: response count, completion rate (started versus submitted, if you track starts) and median completion time.
- 02Per-question view: bar charts for choice questions, average and distribution for ratings, and a scrolling list for text answers with a search box.
- 03Individual responses: one response at a time, with previous and next.
- 04Filters: "show only responses where Role is Teacher", applied to every chart.
- 05CSV export: one row per response, one column per question, multiple choice joined with semicolons.
Add an email to the form owner on each new response (or a daily digest for busy forms) so they do not have to keep checking. If your app has AI features turned on, a "summarize the text answers" button is a genuinely useful extra for long-text questions, as long as it shows the answers it summarized.
Leave out of v1
- Themes and custom CSS per form. One clean, accessible style is better than ten half-styled ones.
- Calculated fields and scoring quizzes.
- Partial save and resume for long forms (unless your forms are genuinely long).
- Integrations with other tools. CSV export covers the first months.
The brief
Build a survey builder for my team. Admins create forms made of sections and questions; question types are short text, long text, single choice, multiple choice (with optional Other), 1 to 5 rating, 0 to 10 scale, number, date, email and file upload (private bucket, 10 MB max). Section-level skip logic shown as plain sentences, with hidden sections not blocking submission. Each form gets a public link; anyone can submit while the form is open, only admins can read responses, enforced with row level security. Store answers as one row per question with a copy of the prompt text. Block changing a question type once it has answers. Results page with summary stats, per-question charts, text answers with search, filters that apply to every chart, individual response view and CSV export. Server-side validation, a honeypot field and a limit of 100 submissions per form per hour. Email the form owner a daily digest of new responses.
Forms are a classic internal tool; the guide to building internal tools without developers covers more of that family, and the business use case shows related builds. To use surveys for product research, see how to collect user feedback.
Frequently asked questions
Can people fill in my survey without an account?
Yes. Give the responses table an insert-only rule for open forms, so anyone can submit and only the form owner can read the results.
How do I stop someone answering twice?
Require sign-in or send each person a unique link that works once. IP-based limits are unreliable because offices, schools and phone networks share addresses.
What is skip logic in a survey?
Rules that send respondents to different questions based on earlier answers, such as skipping to the end when someone answers No. Keeping rules at the section level makes them easy to read and test.
Can I export survey results to a spreadsheet?
Yes. Build a CSV export with one row per response and one column per question. Startbase Cloud's table browser can also export any table to CSV, up to 10,000 rows.
