Legacy Knowledge Base
Published Jul. 2, 2025

How can I share Forms, Element Sets and Data Providers between sites?

Written By

Tímea Bihari

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • I would like to use already existing Forms, Element Sets and Data Providers on another site, without having to recreate them. What are my options?

Environment

  • Liferay DXP 7.1+

Resolution

Forms

Option 1: Forms can be shared from the Global site the following way:

  1. Create the form in the Global site (Content > Forms)
  2. Go to another site (e.g.: Liferay DXP)
  3. Place a Forms portlet on the page
  4. Go to the "Configuration" menu of the portlet
  5. Go to the "Scope" tab
  6. Select "Global"

Result: You will be able to display forms created on the Global site.

Option 2: With the Form's URL

When you publish a form, you will receive a URL from Liferay to access that form (for example http://localhost:8080/web/forms/shared/-/form/33755). That link does not denote the site where the form belongs to. It can be used as the target link for some of the page types offered by DXP 7.1, 7.2 and 7.3:

  • Link to URL
  • Embedded (note that "Embedded" page type uses iframe)

Follow the steps below to test these approaches:

  1. Create a new page on a site
  2. Select the "Embedded/Link to URL" type
  3. Name the page and click Save
  4. In the next window, for URL, enter the Form's URL

Result:

  • If you selected the type "Embedded", the form will appear on the new Page.
  • With the "Link to URL" type, navigating to the new Page will open up the form in the browser tab.

Advantages:

  • You can utilize the permission system.
  • Pages can be added to navigation menus and are shown in the site as if they were "native".

At the same time, please note that all responses will be associated with the form, therefore, to the site where it lives.

 

Element Sets


As for Element Sets, unfortunately, it is a current limitation to share them between sites. A workaround for this might be to export a "template form", containing the required element set(s) and import them in another site. A feature request for this functionality has already been raised. Please see the details in this Knowledge Base article: How can I export/import my form's Element Sets?

Data Providers


Data Providers can be shared from the Global site as well. The option to use the Data Provider created in the Global scope will appear when you create the form itself. For example:

  1. Create a Data Provider on the Global site
  2. Switch to another site (e.g.: Liferay DXP)
  3. Go to Content > Forms
  4. Create a new form
  5. Add a "Select from list" field to the form
  6. In the field configuration, under the "Create List menu", select "From Data Provider" option

Result: Notice that in the "Choose a Data Provider" drop-down, the Data Providers from the Global site will appear.

Additional Information

  • A feature request ticket has been raised: LPS-79792 Allow user to export/import Element Sets with a portlet export. 

 

Did this article resolve your issue ?

Legacy Knowledge Base