[idea] Add support for a composite form

Created on 11 January 2022, over 2 years ago
Updated 5 April 2024, 3 months ago

Problem/Motivation

For complex and huge forms that require 100's of inputs and take a few hours to complete, the collected information can and should be broken down into subforms, which an end-user can complete over multiple user sessions.

Proposed resolution

Add support for building a composite form via a new sub-module or dedicated contrib module.

Possible Approach

  • Provide a new "Composite Form" element which references other webforms to create a parent to child relationship
  • Use a webform entity reference to allow form builders to select each child form.
  • Each child-form tracks the "Composite Form" submission id as the source entity.
  • Child form should require a source entity.
  • Allows all data to be previewed and submitted at once
  • Provide a navigation/progress bar block
  • Possibly allow a preview of a child form's submission data
  • Child forms can be opened using a dialog or dedicated page
  • Child forms could be validated to get their completion rate.
  • Child forms validation error/status (Complete, Draft, Errors) could track as the composite form values
  • Composite Form can alter the child forms adding back to link and progress bar.
  • Composite Form can pull all values from child form to generate a CSV. (This would be not easy to do)

Tokens.

  • Child to Parent form token [webform-submission:source-entity:values:email]
  • Parent to Child form token [webform-submission:elements:{composite_form}:{child_form}:values:email]

Notes

  • User must be authenticated for a Composite Element to work expected.
  • It is possible that a draft submission must be created before a user begins the process. For example, the "Composite Element" could be the second step of a multi-step form. The first step could be an intro page with a "Get started" button. The third step could be the preview.

Examples

  • College Application (Contact, Demographic, Academics, References, Terms and Conditions)

Remaining tasks

TBD

User interface changes

New form element and module

API changes

TBD

Data model changes

Hopefully none.

✨ Feature request
Status

Closed: won't fix

Version

6.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • This would be useful and probably simpler than custom composite fields.

    I have an entityform in D7 that has an unlimited-value entity reference field that points to a Field Collection, and it uses the Embedded field type. I'm not sure how to do that in D9+ with webforms. Is it best to use a Custom Composite field for now? One of the fields in the field collection is a taxonomy term entity reference, and that isn't an option in the field type dropdown when adding a custom composite field.

  • πŸ‡ΊπŸ‡ΈUnited States mrconnerton

    In addition to Child forms can be opened using a dialog or dedicated page it would be great if Child forms can be opened inline similar to inline_entity_form

  • Status changed to Closed: won't fix 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    This will be handled in a dedicated contributed module.

Production build 0.69.0 2024