Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

Webform Pre-populate

No security coverage

Part of the Webform ecosystem · 161 projects

View on drupal.org

Pre-populate a Webform with an external data source without disclosing information via the URL.

Use case

When user data are not stored in Drupal and Webform elements have to be prepopulated. Passing values as plain URL parameters are disclosing information in some cases:

  • When they are passed over http
  • Values can be stored in the server logs
  • Values can be stored in analytics tools (e.g. Google Analytics)

Since GDPR, deleting these data could be something hard to tackle.

Proposed solution

Pass a hash in the url (user id's could be easy to guess) so a mapping can be done between the systems.

Currently, only the file data source is supported. This could be extended later with API calls and authentication.

Prepare a file

The file should be csv and have e.g. the following structure:

hash, name, email

d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35, Marvin,
[email protected]

Where

  • hash is the relation with Drupal and the external system (e.g. Mailchimp)
  • name and email are keys of a Webform element, any other keys (csv columns) might be used.

Upload the file and configure the Webform

  • Choose a Webform: Structure > Webforms
  • Select the Settings tab then Form
  • Under Form behaviors > Prepopulate check Allow all elements to be populated using query string parameters
  • Check then Use a file to prepopulate and upload the file.

This action will store the file in the database and delete the file from the file system. Prepopulate can be temporarily disabled by unchecking Use a file to prepopulate, data are still stored for a later use.

Preview, test and delete prepopulate data.

On the Build tab, select Prepopulate.

Roadmap

  • Add option to upload other formats (e.g. xls)
  • Add option to create the hash from a column and download the list
  • Configure token (default pre-populate override)
  • Check ways to include composite elements on a flat csv structure
  • Improve PhpDoc

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Aug 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
2.0.0 Stable Aug 1, 2023
2.x-dev Dev Aug 1, 2023