Auto-fill using API
How to Auto Fill Forms with External Data
Pre-filling form fields using APIs can save time, reduce errors, and streamline workflows for both form creators and respondents. With Formester, a free AI-powered form builder, you can automatically pull data from external databases like Google Sheets, Airtable, Notion, Excel, or CRMs, and populate your form fields dynamically.
Why Use API-Powered Pre-Fill
This feature is ideal when you want to:
- Auto-fill employee information in HR forms based on employee ID.
- Populate client details in onboarding or project request forms.
- Sync data between multiple databases, reducing manual entry and errors.
- Automate workflows by pre-filling forms and sending follow-ups based on existing data.
For example, if a respondent enters their employee ID, the form can automatically fill in their first name, email, and department, saving them the effort of typing out details and reducing the risk of mistakes.
How to Set Up API-Powered Pre-Fill
- Open Your Form: Log in to Formester and select or create a form. For this example, we use an employee time-off request form.
- Prepare Your Database: Create a database in Google Sheets (or other supported tools) with fields such as employee ID, first name, email, and department.
- Enable Pre-Fill via API: Go to Share > Pre-Fill Fields and select the API feature. Choose the template for your database (Google Sheets, Airtable, Notion, HubSpot CRM, or custom connection).
- Configure the API Connection: Provide required values such as spreadsheet ID, range, and API key. For Google Sheets, generate an API key in Google Cloud Console. Set up environment variables in Formester to securely store API keys.
- Map Form Fields: Use the form field variables to match database fields with your form fields. Assign a search value to identify the data, e.g., employee ID.
- Set API Trigger: Decide when the API should run:
- On Page Load: Automatically pre-fill as soon as the page loads.
- On Field Change: Pre-fill when the respondent interacts with a specific field.
- After Form Submit: Use submitted data to pre-fill other forms or databases automatically.
- Assign Dynamic Values: For each form field, select Variable Value in the default value settings and link it to the API data.
Testing the API Pre-Fill
Once set up, test your form by entering a sample search value, like an employee ID. The API should pull corresponding details (name, email, department) from your database and automatically populate the form fields. Respondents only need to complete the remaining fields before submitting.
Benefits of Auto-Filled Forms
- Saves Time: Reduces repetitive data entry for respondents.
- Reduces Errors: Minimizes mistakes in names, emails, or other critical information.
- Supports Complex Workflows: Can integrate multiple databases and pre-fill fields dynamically based on input.
- Enhances Professionalism: Creates a smoother, automated experience for clients, employees, and other respondents.
API-powered pre-fill transforms your forms into smart, dynamic tools that streamline data collection, improve accuracy, and automate repetitive tasks. By connecting your forms to external data sources, you can save time and make workflows more efficient.
Updated on: 03/10/2025
Thank you!