1.3.1 Create your first form

IMPORTANT
In order to complete this exercise, you need to have access to a working AEM Assets CS Author environment with AEM Assets Dynamic Media enabled.
If you don’t have such an environment, go to Adobe Experience Manager Cloud Service & Edge Delivery Services. Follow the instructions there, and you’ll have access to such an environment.
IMPORTANT
If you have previously configured an AEM CS Program with an AEM Assets CS environment, it may be that your AEM CS sandbox was hibernated. Given that dehibernating such a sandbox takes 10-15 minutes, it would be a good idea to start the dehibernation process now so that you don’t have to wait for it at a later time.

1.3.1.1 Environment requirements for using AEM Forms with Edge Delivery Services

Prior to configuring your first form, there are a number of requirements that need to be met before you can follow the below steps.

Program setup

In the Solutions & add-ons of your Cloud Manager Program, Forms needs to be enabled.

AEM Forms

blocks

In your Github repository, you need to have the following blocks available:

  • form
  • embed-adaptive-form

AEM Forms

scripts

In your Github repository, you need to have the following scripts available:

  • form-editor-support.css
  • form-editor-support.js

AEM Forms

Additionally, in the file editor-support.js, the following changes need to be done to enable editing forms in the Universal Editor.

  • change function declaration from function attachEventListners(main) to async function attachEventListners(main)
  • add lines 152 and 153:
const module = await import('./form-editor-support.js');
module.attachEventListners(main);

AEM Forms

Also, in the file editor-support.js, change lines 90-92 like this:

if (block.dataset.aueModel === 'form') {
        return true;
      } else if (newBlock) {

AEM Forms

paths.json

Please verify your Github repo configuration, specifically in the file paths.json. These lines need to be present in the file:

  • Under mappings: “/content/forms/af/:/forms/”
  • Under includes: “/content/forms/af/”
{
  "mappings": [
    "/content/CitiSignal/:/",
    "/content/CitiSignal/configuration:/.helix/config.json",
    "/content/CitiSignal/headers:/.helix/headers.json",
    "/content/CitiSignal/metadata:/metadata.json",
    "/content/CitiSignal.resource/enrichment/enrichment.json:/enrichment/enrichment.json",
    "/content/forms/af/:/forms/"
  ],
  "includes": [
    "/content/CitiSignal/",
    "/content/forms/af/"
  ]
}

AEM Forms

With these requirements in place, you can create your first form.

1.3.1.2 Create form

Go to https://my.cloudmanager.adobe.com. The org you should select is --aepImsOrgName--. Open your environment.

AEM Forms

Go to Forms.

AEM Forms

Go to Forms & Documents.

AEM Forms

Click Create and then select Adaptive Form.

AEM Forms

Select Edge Delivery Services and then select Blank Page. Click Create.

AEM Forms

You should then see this. Fill out the following fields:

  • Title: Fiber Max Interest Form
  • Name: should be populated automatically based on the field Title.
  • Github URL: provide the path to the Github repo that is linked to your website

Click Create.

AEM Forms

After clicking Create, the Universal Editor should open automatically and you should see something like this. Click the icon to open the Content Tree.

AEM Forms

In the Content Tree, select the object Adaptive Form.

AEM Forms

Then, click the + icon to add a new element, and select text Input.

AEM Forms

In the Content Tree, select the field Text Input.

AEM Forms

Go to the Basic view. You should see this.

Fill out the following fields:

  • Name: first-name
  • Title: First Name

Then, go to Validation.

AEM Forms

Flip the switch to make this a required field. Fill out the following fields:

  • Error message: Enter your first name
  • Pattern: [A-Za-z][A-Za-z ]+
  • Pattern error message: Letters only!

AEM Forms

In the Content Tree, select the field Adaptive Form. Click the + icon and then select text Input.

AEM Forms

In the Content Tree, select the newly created field Text Input. Go to Properties.

AEM Forms

Go to the Basic view. You should see this.

Fill out the following fields:

  • Name: last-name
  • Title: Last Name

Then, go to Validation.

AEM Forms

Flip the switch to make this a required field. Fill out the following fields:

  • Error message: Enter your last name
  • Pattern: [A-Za-z][A-Za-z ]+
  • Pattern error message: Letters only!

AEM Forms

In the Content Tree, select the field Adaptive Form. Click the + icon and then select text Input.

AEM Forms

In the Content Tree, select the newly created field Text Input. Go to Properties.

AEM Forms

Go to the Basic view. You should see this.

Fill out the following fields:

  • Name: email
  • Title: Email

Then, go to Validation.

AEM Forms

Flip the switch to make this a required field. Fill out the following fields:

  • Error message: Enter your email address
  • Pattern: ^[^@]+@[^@]+\.[^@]+$
  • Pattern error message: Please verify your email address!

AEM Forms

In the Content Tree, select the field Adaptive Form. Click the + icon and then select text Input.

AEM Forms

In the Content Tree, select the newly created field Text Input.

AEM Forms

Go to the Basic view. You should see this.

Fill out the following fields:

  • Name: city
  • Title: city

Then, go to Validation.

AEM Forms

Flip the switch to make this a required field. Fill out the following fields:

  • Error message: Enter your city
  • Pattern: [A-Za-z][A-Za-z ]+
  • Pattern error message: Letters only!

AEM Forms

Click Publish.

AEM Forms

Click Publish again.

AEM Forms

Click to open your form.

AEM Forms

You can then fill out the form, but you can’t submit it yet.

AEM Forms

After publishing your form, it’s now also available on your Edge Delivery Services domain, which looks like this:

https://main--techinsidersXX-citisignal-aem-accs--woutervangeluwe.aem.page/forms/fiber-max-interest-form

AEM Forms

1.3.1.3 Submit form

In order to submit your form, 2 things are required:

  • a Submit button
  • a Submit action

Also, in this exercise you should use a Google spreadsheet to record submissions of this form.

Google spreadsheet

Go to https://drive.google.com and create a new blank spreadsheet.

AEM Forms

Name your file citisignal-fiber-max-interest.

In line 1, in cells A-B-C-D, enter the following field names:

  • first-name
  • last-name
  • email
  • city

Then, click Share.

AEM Forms

Share the file with forms@adobe.com with Editor-level access rights.

Then, click Copy link.

Click Send.

AEM Forms

You will need to use the copied link in the next step.

Submit button

To configure the Submit button, go to Content tree, select Adaptive Form, click the + icon and then select Submit.

AEM Forms

You should then see this.

AEM Forms

Submit action

Submit actions are part of an extension for the Universal Editor.

NOTE
If you don’t see the Edit Form Properties icon, it means that this etxension isn’t enabled for your environment yet. To enable this extension, go to https://experience.adobe.com/#/aem/extension-manager and enable the Edit Form Properties extension.
AEM Forms

Click the Edit Form Properties icon.

AEM Forms

Select Submit to Spreadsheet. Paste the URL of the Google Sheet that you created earlier.

Click Save & Close.

AEM Forms

NOTE
If you receive an error 401 - Unauthorized, it may be. because your environment hasn’t been enabled to work with Google Sheets. Contact your Adobe representative to have your environment enabled.

Click Publish.

AEM Forms

Click Publish again.

AEM Forms

You can then refresh your site, fill out the forms and click Submit.

AEM Forms

Your submission should then be successful.

AEM Forms

If you then have a look at your Google sheet, you should see the successful submission there as well.

AEM Forms

You’ve now successfully finished this exercise.

Next Steps

Go Back to Adobe Experience Manager Forms with Edge Delivery Services

Go Back to All Modules

recommendation-more-help
4bbf020c-24db-4a43-b239-88fab142f02d