Skip to content

Webforms

Webforms are the FedMS solution for any structured data capture: registrations, feedback surveys, pre-event questionnaires, post-event evaluations, internal forms.

FedMS uses the standard Drupal Webform module plus two important extensions:

  • Webform Content Creator — syncs webform submissions back to entity fields (e.g. a profile-update form syncs to the user entity).
  • Webform paragraph — embeds a webform as a paragraph inside events/sessions.

Where to author webforms

1
/admin/structure/webform

You need the appropriate webform admin permissions. By default, Content Managers have them.

Creating a webform

Standard Drupal Webform UI:

  1. Add webform → label, machine name.
  2. Drag in fields from the element library: text, email, select, radios, checkboxes, date, signature, file upload, sections, conditionals…
  3. Configure validation, default values, conditional visibility per element.
  4. Configure submission handlers (email, save, third-party integrations).
  5. Configure confirmation: redirect vs. reload vs. inline message.

The "stay in context" rule

When a webform is embedded inside another page (e.g. a book page or an event content entity), set the Confirmation type to reload, not redirect. Otherwise the submission takes the user out of the parent page.

Embedding a webform in an event or session

Use the webform paragraph type:

  1. Edit the event/session content entity.
  2. Add a webform paragraph to the description.
  3. Pick the webform.
  4. Save.

The webform now renders in the event/session page, with its submission scoped to the surrounding context.

Syncing submissions to entities

The Webform Content Creator module syncs webform submissions back to a target entity. The classic use case: a profile-update webform that writes to the user entity.

Configuration

/admin/config/webform_content_creator

  1. Add configuration — label, source webform, target entity type, target bundle.
  2. Pick Synchronize the creation/edition of content based on unique content field.
  3. Enter the synchronization field machine name — the field name in the entity that uniquely identifies the row to sync to (e.g. uid for users, id for content entities).
  4. Save the configuration.
  5. Manage fields — for each entity field you want to sync, pick the matching webform element. Don't forget the ID field itself!

The "sync to current user" recipe

For a webform that updates the current user's profile:

  1. Add a hidden element with key uid and default value [current-user:uid]. Drupal will warn that uid is reserved — ignore the warning.
  2. Configure Webform Content Creator as above with uid as the synchronization field machine name.
  3. Map each form element to the corresponding user field.

The full step-by-step recipe is preserved at:

1
2
3
4
5
6
7
8
9
- create the webform with elements (fields) that sync to user fields
- add hidden 'uid' element with default [current-user:uid]
- /admin/config/webform_content_creator → add config
  - name, webform, entity type 'user', bundle 'user'
  - 'Synchronize based on unique content field'
  - Synchronization field machine name: 'uid'
- 'Manage fields'
  - Map UID field to webform 'uid'
  - Map each user field to the matching webform element

Task patterns on webforms

A webform can declare task patterns via its third-party setting fedms.patterns_form. When a user is added to a group, the task_api model considers webforms with that pattern, and spawns "Fill in this webform" tasks for the right users.

When a webform task is spawned, FedMS automatically creates an empty draft submission linked to the task to disambiguate the relationship — see fedms/components/tasks#20.

Webform permissions for Content Managers

Content Managers need to be able to author webforms. The fix for "webform permissions for Content Manager" is tracked at fedms/support#23 and fedms/support#34.

Common gotchas

  • Confirmation typeredirect breaks book/event embeds; use reload instead.
  • Embed-in-modal limitation — webforms with media fields cannot be opened inside a modal dialog. See fedms/components/eca#7.
  • uid warning — ignore Drupal's warning about reserved key names when intentionally using uid for sync.

Next steps