Skip to main content


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

Data Transform form - Update Page action

Updated on January 14, 2022

Use the Update Page action to set values on a target page that is different from the data transform's primary page.

Usage

The Update Page action sets the page context for the subsequent (children) steps. Using the Update Page allows you to:

  • Avoid entering the target page name each time in the children Set actions
  • Use source values from a page that is different from the data transform's primary page

For example, the following data transforms are equivalent:

Set pyWorkPage.CustomerType equal to "Existing"

Set pyWorkPage.CustomerLevel equal to "Bronze"

and

Update Page pyWorkPage
  Set .CustomerType equal to "Existing"
  Set .CustomerLevel equal to "Bronze"

In the second example, the Update Page action sets the page context to the pyWorkPage, so that the page does not have to be specified for the Target fields in the following child steps.

You can set the page context for the target only, or for both the target and source. To set the page context for the source, select with values from in the Relation field.

JSON data model format

When the data model format is JSON, there are the following differences in behavior:

  • The order of the steps is not guaranteed.
  • The data transform is bidirectional.

In addition, the JSON field requires a JSON object name.

Examples

Update Page pyWorkPage
  Set .ZipCode equal to "02139"
  Set .TelPrefix equal to "617"
Update Page pyWorkPage with values from Employees
  Set .ZipCode equal to .PostalCode
  Set .TelPrefix equal to .Prefix

Relation column

The following relationship settings are available when the data model format is clipboard:

  • blank – The default. Use when setting values on a target page using source values that are on this data transform's primary page (the clipboard page with the same class as the data transform's Applies To class).
  • With values from – Use when the source values are on a page other than the data transform's primary page.

The following relationship settings are available when the data model format is JSON:

  • For both sides – Set the page context for both the JSON and clipboard sides.
  • For JSON only – Set the page context for the JSON side only.
  • For clipboard only – Set the page context for the clipboard side only.

JSON relationship settings example

This example illustrates how to use the relationship settings. The JSON for a customer is as follows:

{
		       	"id": 123456,
    			"name": "John Doe",
	    		"email": "[email protected]",
		    	"address": {
        			"addressLines": {
		            	"line1": "1 example st",
		            	"line2": "example building"
		    	    },
			        "city": "Example",
		        	"zip": "02142"
			    }
			}

The clipboard structure is as follows:

Customer
		     ID
		    Name
		    Email
	     	Address
		        AddressLine1
		        AddressLine2
	        	City
		         Zip

The tree structures match except for the address line fields. line1 on the JSON side is under the address > addressLines hierarchy, but its corresponding AddressLine1 property on the clipboard is directly under Address. In this case, use the Update Page action to update context only on one side. To map the entire structure, update the context for address on both sides, then update the context only on the JSON side, and then map individual properties, as shown in the following sample:

Update PageAddressFor both sidesaddress

Update PageNo context changeFor JSON onlyaddressLines

SetAddressLine1equal toline1

Supported features

You can use the following items in the Update Page action:

  • Page (top-level or embedded clipboard page)
  • Page in a Page List
  • Page in a Page Group
  • Keywords: <APPEND>, <LAST>, Primary
  • Expressions in the index (subscript) of an aggregate property

Restrictions

  • You cannot use the Parent keyword.
  • Do not use the Top keyword in data transforms. In some situations, using Top does not work if a top-level page is not clearly defined (for example, if a row has both source and target pages).
  • You cannot use data pages (pages that are instances of data page rules).
  • Previous topic Data Transform form - Sort action
  • Next topic Data Transform form - When, Otherwise, and Otherwise When actions

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