-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Configurable question tags #4694
base: main
Are you sure you want to change the base?
Conversation
🧪 Review environmenthttps://obytdidilnzksu3rs764gwacne0kjhov.lambda-url.ca-central-1.on.aws/ |
🧪 Review environmenthttps://q27nmmlfkmheb4cme7spqbyn2y0jfxna.lambda-url.ca-central-1.on.aws/ |
<div> | ||
<InfoDetails summary={t("How tags can help")}> | ||
<div className="mb-8 mt-4 border-l-3 border-gray-500 pl-8"> | ||
<p className="mb-4 text-sm">{t("text description")}</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a proper description here
<section className="mb-4 mt-8"> | ||
<Label htmlFor="">{t("Question tag")}</Label> | ||
<Hint> | ||
{t("Adding a question tag allows the question to contain a permanent identifier.")} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need proper i18n here
Tested --- working well Updated my API test app to use const getAnswerByTag = (answersObj, tag) => {
const answers = Object.entries(answersObj );
const entry = answers.find(([_, value]) => value.tag === tag);
return entry ? entry[1].answer : null;
}; const answers = JSON.parse(formSubmission.answers);
const email = getAnswerByTag(answers, "email"); Note👉 Any existing partner integrations that aren't published would need to be update to pull from .answer prop on the response. |
Summary | Résumé
#4378 "Machine readable tags or IDs":
About tagged responses
A tagged response has the following structure:
The answer string can sometimes be a serialized object - in the cases of FormattedDate and AddressComplete, they will be serialized JSON. Checkboxes also render as a serialized object/array of values.
When responses are downloaded as HTML or CSV they pass through the fetchSubmissions server action, where the response will be extracted and returned without the tag.
When responses are downloaded from the API, they will be returned following the object structure above.
If a form was created before this feature rolls out, but modified after- pre-existing inputs will not have tags, any newly added inputs will have tags. Tags can be added to pre-existing inputs by opening the MoreDialog, editing the tag, and saving.
If a form has a mix of tagged and untagged inputs, the responses to that form will have mixed tagged/untagged responses.