AEM Forms: The Benefit of Reusability

AEM Forms: The Benefit of Reusability

Working in the technology industry we’ve all been in the position where we’ve had to redo part of a project because you forgot to save a file, someone overwrote your assignment, or you’ve had to work with a CMS where you’re constantly having to recreate the same content. The latter would include common elements like the site header, footer, or sidebar. This is where AEM Forms can come in very handy with its ability to create once and use everywhere.

Miss the first article in our AEM Forms series? Learn about the technology and architecture of AEM Forms in part 1.

AEM Form Fragments

AEM forms come with an extremely useful feature called form fragments. Form fragments are sections of a form that you can reuse across multiple forms on the site. For example, a signature or an address block. With form fragments you can create multiple segments and use them throughout your forms.

In this example we will create an address block fragment:

Creating a fragment

    1. Click Create > Adaptive Form Fragment.
    2. Specify title (Address Block), description (Address block for work), and any necessary tags for the fragment (Optional).
    3. Click to open the Form Model tab, and from the Select From drop-down menu, select the “none” option since we are creating a form fragment from scratch.

NOTE: You can also create a form template using an XDP template (typically imported from Livecycle) uploaded to AEM Forms.

Save panel as a fragment

  1. Open an adaptive form that contains the panel you want to save as an adaptive form fragment.
  2. In the panel toolbar, click Save as Fragment. The Fragment Creation dialog opens.
  3. Fill in the necessary details for the fragment
  4. Click OK. The panel is saved at the specified or the default location in the repository.

Insert a fragment in an adaptive form

Now that you’ve created a panel as a fragment we can insert it into an adaptive form.

  1. Open the adaptive form in which you want to insert the adaptive form fragment into
  2. Click the Adaptive Form Fragments tab in the AEM content finder. All available adaptive form fragments appear in the tab. Insert the “Address Block” form fragment that we just created into your form.
  3. Drag-and-drop an adaptive form fragment onto an adaptive form that you have already created.

Looking Ahead

Adaptive forms can be a lifesaver when you have hundreds (or thousands) of forms where you want to insert a common element. From our address block example above, you can see that you don’t need to re-create an address block each time you create a form, which is a huge time saver. It’s just one of the many advantages of AEM Forms. Be on the lookout for our next post in our AEM Forms series where we will talk more in-depth about managing assets.

If you’re in the process of optimizing or implementing your AEM solution, we can help. Reach out to our team today.