Integrating Forms With an External Database

See how we automated the form sending system and improved administrators’ work

Client

LINK4

Industry

Insurance

Technologies

logo Drupal Drupal

Main benefit

Automated form integration and simplified administrators’ work

Background element

Our client, LINK4, used website forms for users to submit their inquiries. It also had its own external database for storing and further processing these queries. The problem was that the data from the forms was not automatically transferred to it. We had to find a solution that allows submissions in a format adapted to the database's requirements.

Our solution relies on a handling mechanism in Webform – the module responsible for Drupal forms. It controls what happens to the data after the inquiry is submitted. To keep it simple, we ensured that the administrator selects the form type from the database, so there is no need for code intervention. The list of forms itself is retrieved from the client’s API.

How does it work?

  1. The user submits a query, which the system converts to JSON format. This ensures the data is properly structured and can be sent directly to the customer database.
  2. The form with fields for mapping in the handler is generated automatically.
  3. After submitting the form, the data is transferred to the client's external database via an AJAX request.
  4. The system checks whether the submission meets all requirements. If an error occurs, the user will receive a clear message directly next to the form on the website. Reloading the site is not necessary, so they can immediately correct the indicated fields.

Efficient form linking is enabled primarily by a field-mapping mechanism.

Our solution significantly simplified the administrator's work – the automated integration is very easy to maintain. All you need to do is map the fields for a given form once to properly connect it to the database. Once this configuration is complete, all subsequent web forms are automatically submitted. Importantly, the system collects submissions from various services, not just the Drupal application.

The solution is tailored to the client’s specific requirements, but some elements are universal and can be used in other projects.

LINK4 – web forms

Kewin Böhm

Drupal Developer

We wanted the solution to be universal and flexible. The most time-consuming stage of the project was developing the mechanism for generating the field mapping form. Each submission has its own structure, which can be more or less complex. This required understanding the data schema and developing methods that would automatically create the form for mapping webform fields.

Link4 case study

LINK4

We spent over 2600 hours on this project. The effects exceeded our expectations. Check the implementation details of a new corporate website on Drupal for the motor insurance market leader.

logo Drupal Logo Elasticsearch Logo Vue.js
See case study
Background element
  1. When your website has multiple forms that need to be sent to the same database.

  2. When you need to integrate queries with your company's internal systems.

  3. When you handle inquiries and store contact history in a custom system.

Want to integrate forms on your website?