Data Transform form - Update Page action
Usage
The Update Page action sets the page context for the subsequent (children) steps.
Use the Update Page action when you want to set values on a target page that is different from the data transform's primary page, and you want 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 children 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 list.
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
Relationship settings
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:
pyCustomer
-pyID
-pyName
-pyEmail
-pyAddress
-pyAddressLine1
-pyAddressLine2
-pyCity
-pyZip
The tree structures match except for the address line fields. line1
on
the JSON side is under the address > addressLines
hierarchy, but its
corresponding pyAddressLine1
property on the clipboard is directly under
pyAddress
. 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, then map individual properties, as shown in
the sample below:
Update PagepyAddress
For both sidesaddress
Update PageNo context change
For JSON onlyaddressLines
SetpyAddressLine1
equal 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.
- It is not recommended that you use the Top keyword in data transforms. There are situations where 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