Skip to content

[FormTribe 🔥][750 Points] Hidden Fields #887

@jobenjada

Description

@jobenjada

Welcome to the FormTribe

This issue will get you 750 points for the FormTribe Hackathon

Preparation:
If this is your first time contributing, please read:

Only when your PR follows all of the best practices it will get merged.

Want more points quick? Complete Side Quests 🏰


Users want to submit additional (meta-) data along with a link survey without having to set an attribute

Describe the solution you'd like

We allow custom hidden fields in link surveys that can be set via search parameters in the URL.

Feature Description

  • A user adds a hidden field to a survey in the survey editor.
    In the settings, the user assigns a name to the hidden field (make sure they are unique and don't conflict with current features and forbid names like userId& suid and the questionIds of the current survey.
  • In link surveys, the content of the hidden field can be set via an URL search param follow this schema: "?hiddenfieldname=hiddenfieldcontent"
  • We only support this in link surveys for now. We can add an option for web-app surveys later.
  • The content is stored in the response data and displayed in the Summary and Response tabs

Notes

  • This is only for link surveys, not for in app surveys
  • We already have the whole logic to take data from the URL and add it to the submission in the Link Prefilling feature built by Piyush. Reuse as much of this logic as possible.
  • Add the string to the submission via URL parameters

Tasks

  1. Add a new Card called "Hidden Field" with Hero Icon EyeSlash which is only visible if the survey type === "linkSurvey" below the Thank You Card in the Survey Editor. In this card, users can add several hidden fields by adding a hidden field Id:
image
  1. We built the UI you need already for our tagging system:
image

While building this, make sure to validate the inputs as follows:

  • Do not allow spaces
  • Do not allow userId & suid
  • Do not allow any of the question Ids of the current survey since they can be used for link prefilling

User can add and remove hidden fields with the UI.

  1. Now that the settings are complete, let's make it possible to attach a value to the hidden field Id. To be able to do that, allow people to prefill the hidden fields via URL parameters in the LinkSurvey.tsx. We already have quite some link prefilling logic in the file, it should be pretty straight forward 👍

  2. Test extensively with User Identification, Single Use Links, Prefilling of first question

Thanks!!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthacktoberfestcomplete these issues to gather points for Hacktoberfest

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions