AEM, Technical Development

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.

AEM Form Fragments

AEM forms comes 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.
    1. Specify title (Address Block), description (Address block for work), and any necessary tags for the fragment (Optional).
  1. 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
    1. 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.
  1. 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.

John Zeren
John Zeren has over 12 years of industry experience with a passion and focus on web application development. As the VP of Software Development, John is responsible for ensuring quality and consistency in our delivery to our customers as well as helping to maintain and build strong relationships. He is also responsible for the tactical and operational direction for the Digital Solutions team and ensuring that individuals have the best means and opportunities to succeed, thrive, and grow in a fast-paced environment.
View All Posts By This Author

Subscribe to Our Newsletter

Get the latest insights from Blue Acorn iCi

Let's build something together.