# Refer datapage with parameters in HTML rule in Pega

We might have come across or probably used `pega: reference` jsp tag to refer properties in HTML rules like Fragment, Correspondence, Paragraph etc.

There could be a scenario where we have to refer a parameterized Datapage in a HTML rule. But the syntax to access or refer a Datapage with parameters doesn't work.

```plaintext
D_PageName[param1: value1, param2: value2].PropertyName
```

However, there is a workaround to refer properties from parameterized Datapages.

> Note: It is not recommended to use this method. Better way is to construct a new Datapage or a normal page with all values and use as reference in HTML rule.

By setting the required parameters using java scriplet prior to using a reference tag, system will load the Datapage and the properties will be constructed in HTML rule.

![Screenshot of code snippet in HTML](https://cdn.hashnode.com/res/hashnode/image/upload/v1667068632496/BXeK9UzjR.png align="left")

```plaintext
<!-- Sample snippet to refer parameterized Datapages -->

<%
   // Set all parameters required for datapage
  tools.putParamValue("OperatorId", "administrator@pega.com");
 // Set all other params required for datapage
%>
    <div>
        <h1>Referencing Parameterized Data Page in HTML Rule</h1>
        <div>
            Name: <pega:reference name="D_pxOperatorDetails.pyUserName" />
        </div>
      <div>
            Email: <pega:reference name="D_pxOperatorDetails.pyAddresses(Email).pyEmailAddress" />
        </div>
      <div>
            TimeZone: <pega:reference name="D_pxOperatorDetails.pyDefaultTimeZone" />
        </div>
    </div>
```

#### And the result looks like this

![End result of Datapage with params in HTML](https://cdn.hashnode.com/res/hashnode/image/upload/v1667068557945/Y50szZ_t3.png align="left")

Hope this helps and be very careful to refer properties from parameterized Datapage using this method. This is not supported and there is no official documentation.

If there any questions, feel free to reach me.

Cheers!
