1 of 24

Understanding �A webform submission

2 of 24

Hello!

Hi, my name is Jacob Rockowitz.

  • I am known as jrockowitz on the web.
  • I am a Drupal developer and software architect.
  • I built and maintain the Webform module for Drupal 8.

3 of 24

1.

WHAT IS A �SUBMISSION?

4 of 24

A submission is �data ENTERED INTO �a Webform

5 of 24

2.

HOW IS A �SUBMISSION STORED �IN DRUPAL?

6 of 24

Webform submissionS �ARE CONTENT ENTITIES �BUT FORM ELEMENTS �DO NOT USE FIELD API

7 of 24

webform_submission

8 of 24

webform_submission_data

Value

ATTRIBUTE

EnTITY

9 of 24

Entity–attribute–value model

Entity–attribute–value model (EAV) is a data model to encode, in a space-efficient manner, entities where the number of attributes (properties, parameters) that can be used to describe them is potentially vast, but the number that will actually apply to a given entity is relatively modest.�https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model

10 of 24

3.

Why USE the Entity–attribute–value model?

11 of 24

A simple way�to store�A lot of data

12 of 24

4.

WHAT IS A �SOURCE ENTITY?

13 of 24

SOURCE ENTITY �TRACKS & CREATES �A RELATIONSHIP TO �the Drupal ENTITY �A WEBFORM �WAS SUBMITTED FROM

14 of 24

webform_submission

SOURCE ENTITY

15 of 24

THE SOURCE ENTITY CAN BE USED to track...

  • Site Feedback�A form that tracks which page the comments are related to.

  • Event Registration�A registration form that tracks which event a user has registered for.

  • Application Evaluation�An evaluation form attached to applications.

16 of 24

<demo>

17 of 24

5.

HOW TO Manage a �SUBMISSION?

18 of 24

Managing SUbmissions

  • View�Review data and meta information
  • Edit�Update data and edit administrative elements
  • Notes�Flag/Star and add annotations
  • Resend�Preview and resend messages
  • Log�View all events and transactions

19 of 24

6.

HOW DO YOU ALTER A �SUBMISSION'S DISPLAY?

20 of 24

HOW SUbmissionS are DISPLAYed

  • Data can be displayed as HTML or Text
  • Formatted using very simple render arrays
  • Most elements do not use templates
  • Some elements do use templates
  • Displays can be overridden using inline Twig

21 of 24

<demo>

22 of 24

EXERCISES: SuBMISSIONS

  • Add administrative elements to a submission
  • Alter the display format of a submission value
  • Resend an email notification
  • Override a submission display value using Twig
  • Create a feedback form and attach it to �every page as a block.

23 of 24

jrockowitz.com

24 of 24

THANKS!

ANY QUESTIONS?

Ralph says...