Create Form-like Content in a Notebook

Form Notebooksstructured, form-like content in Wolfram Notebookshave a WYSIWYG-like authoring environment, optimized for inserting form elements and open coding areas to be later scraped into an Association .

Open a new Form Authoring Notebook

Open a new Form Authoring Notebook by selecting it from File New Programmatic Notebook Form Notebook Authoring:

  • Alternatively, you can open a new Form Authoring Notebook programmatically using CreateNotebook [FormNotebookAuthoring].

Add an input field form element

Add an input field from Insert Form Element Input Field:

Customize the form element

In template view, edit the information then select Confirm to finalize the changes:

Examine the information in code view to see the raw FormObject :

Use preview to examine how the information will look in a WYSIWYG fashion before generating the Form Notebook:

Add a key to the form element

Create a Key for the input fields so that you can grab necessary information programmatically:

  • Generally, keys are used to lump certain form elements together across notebooks for easy tabulation. E.g., a teacher grading a quiz and comparing solutions to their real value.
  • Keys are restricted to plain text characters.
  • Only contents associated with a Key in the authoring notebook will be scraped.

Add an editable notebook area form element

Editable notebook areas let end-users execute code in the generated Form Notebook. Add one to the authoring notebook with Insert Editable Notebook Area:

Add content to the editable notebook area and edit the key:

  • Editable notebook areas will scrape all cells entered within them and return raw cell expressions. It is up to the author to futher parse this for the necessary data.

Customize settings

Open the settings and modify them for your needs:

Generate the Form Notebook

Select Generate to create the Form Notebook:

  • All authoring-only elements will be removed after generation.

Fill out and Submit the notebook

Using the generated Form Notebook, fill out the information and submit the form:

The submission is set to CreateDocument , which will output an Association with the relevant Form Notebook information in a new document:

  • CreateDocument is the default submission type.
  • You can change submission types in the settings dialog from a previous step.

Notes

You can exclude content from the generated Form Notebook using Tools Annotate:
Provide a clickable information box in headings using Tools Information Box: