Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Configuring multiple data sources for a data page

Updated on April 6, 2022

Configure multiple data sources in your data page and set parameters that determine which data source to use, so that your application gets the right data every time. By setting parameters in your data page, you eliminate the labor and maintenance cost of creating and maintaining hard-coded calls for data.

Before you begin:
  • Ensure that the data page for which you want to configure multiple data sources has parameters. For more information, see Use case: Referencing data in a data page by using parameters.
  • Create When conditions and configure the parameters. Data pages use a When condition and the parameter values that the referencing page submits to determine what data to send back. For more information, see When condition rules.
When an application invokes a data page, it sends values for one or more data page parameters. The data page uses the parameter values to select which of its data sources to use to respond to the current call, and which data from that data source to return.
  1. In the navigation pane of Dev Studio, click Records.
  2. Expand the Data Model category, and then click Data Page.
  3. Click the name of a data page to open the page.
  4. To specify data sources for the data page, on the Definition tab, in the Data Sources section, click Add alternative source for each data source that you want to add.
    The IF field is displayed above the first source in the list.
    1. In the IF field, identify the When condition that evaluates whether the current reference to the data page requires using the source identified in each row.
      If you add additional sources, the condition for each additional source is set as ELSE IF. You cannot use the same When condition for more than one source.

      The condition for the final data source in the list is set as Otherwise. If all the preceding When conditions evaluate to false, the data page uses the final data source.

    2. Optional: To delete a source, click Delete item.
      You can delete all but one data source.
    3. Optional: To set the order in which the system checks whether the data sources should be used, click the left side of the data source to drag it higher or lower in the list.
    Result: The data page is prepared to respond to references that are sent with parameter values by returning data designed for the needs of each reference. The data page can create a separate instance of itself on the clipboard for each time it is referenced with unique parameter values. Additionally, the data page can restrict the number of data page instances to one, so each new reference overwrites the data page instance on the clipboard.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us