Quiz CSV
Load onboarding-quiz answers as tag affinities: one id column, the columns you map, nothing else.
If your onboarding quiz asks people about their goals, activity or stress, those answers can shape recommendations from day one. You export them as a CSV and write a small mapping from answers to tags in your taxonomy. The importer reads only the id column and the columns you map. Every other column is ignored and counted as dropped, so a free-text column in the export can never reach Patterna.
What the file needs#
- One id column with the random per-tenant user id your backend minted for Patterna. Not an email, not your account id, not an identity-provider id.
- The answer columns you want to use. One row per user. A cell may hold several answers separated by
;.
patterna_uid,main_goal,activity,notes
u_mfrggzdfmztwq2lknnwg23tpobyxe,Beter slapen;Meer energie,moderate,free text that is never read
u_k5xwg3dpmvzgk3lomnqxg5dbmzsw4,Minder stress,low,The mapping file#
The mapping is a TOML file: the id column, and per answer column the tags each answer stands for, with a weight.
id_column = "patterna_uid"
multi_separator = ";"
[columns.main_goal]
"Beter slapen" = { sleep = 1.0 }
"Meer energie" = { energy = 1.0 }
"Minder stress" = { stress = 1.0, recovery = 0.3 }
[columns.activity]
"moderate" = { movement = 0.5 }- Answers are matched case-insensitively after trimming.
- Every tag must exist in your taxonomy. A mapping with an unknown tag stops the run before anything is written; add the tag in Catalog → Taxonomy first.
- Never map a health value: no cycle data, symptoms, weight, diagnoses or anything a person typed in their own words. See Data we never store.
Run it#
python -m patterna_jobs quiz-csv --tenant your-tenant \
--csv quiz_export.csv --mapping quiz_mapping.toml --out quiz_affinities.csvThe run writes the tag affinities per id to --out (for your own records) and merges them into the users Patterna already has. --no-write only writes the output file, which is the way to check a mapping first.
Consent basis#
Quiz answers are attributes the person declared, not behaviour Patterna observed. What happens per mode:
- personalized: the answers are merged into the user's tag affinities and rank together with their behaviour.
- cohort: cohort ranking reads only the goals sent with
PUT /users/{user_id}/profile, not these affinities. For cohort users, send the quiz goals through the profile call from your backend instead. - non_profiled: there is no user row in Patterna, so there is nothing to attach answers to. The row is skipped and counted as dropped (
user.no_profile_row).
You remain responsible for having a basis to share the answers. Record it on your side with the consent you already ask for. See Consent modes.
Check it works#
Connectors → Quiz CSV shows rows in, rows mapped, columns dropped with counts, and errors. Open Audiences → trace for one id from the file to see the merged tag affinities.