Ask AI

Use Case: Job Submission with Hidden Fields

Learn how to use hidden fields on an example.

Here, we'll go through a use case when incorporating hidden fields into your form can be useful.

Let's say you have a job board (built using a List block in our case), which is in turn connected to a List details page for displaying the complete overview of the position. Apart from job details, the details page also contains a form through which visitors can apply for that job. The blocks display data from a data source, which in this case is Airtable. Below you can see what these pages and their corresponding Airtable tables look like.

Job board and job details
Job board and job details

This way, each form submission will be stored under the Job Submissions table. However, since we don't have a field where the user can select which position he/she is applying for, we can't associate the submissions with their related jobs. But instead of adding such a field, we can go one step further and link each form submission to its related job entry in the Jobs table. This is where hidden fields come in handy.

First of all, let's link the two tables through a linked record.

Linking "Jobs" and "Job Submissions" tables
Linking "Jobs" and "Job Submissions" tables

Now, on our form, we'll add a URL parameter hidden field that gets the recordID of the page it has been submitted from and map that field to the Jobs linked record field we just created. As a result, Airtable will locate the corresponding job record from the Jobs table and link it to each new job submission. Now, on our form, weโ€™ll add a Hidden field input that is Mapped to our new Jobs field in the Job Submissions table. Since we are linking to the list details page from our list of jobs, we can choose information from the Current Record to be saved as the value of our hidden field. We can use the primary field (first column) from the Jobs table as the value to send in the Hidden field. In this case itโ€™s the Name of the job.

Notion image

That's it. As you can see, the job submission is successfully linked to its related job record. Whenever a user submits an application on a jobโ€™s detail page, the form will automatically link to the job the user is applying for.

Did this answer your question?
๐Ÿ˜ž
๐Ÿ˜
๐Ÿคฉ

Last updated on December 6, 2022