Skip to main content


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

Data Transform form - When, Otherwise, and Otherwise When actions

Updated on January 14, 2022

Usage

Use the When, Otherwise, and Otherwise When actions to conditionalize data transform actions, so that the system invokes the actions only when the specified conditions are true.

For example, given an ordering process with a form where customers can select a check box to indicate whether their billing address is the same as their shipping address, you can use a When action to tell the system to perform a set of actions (children actions of the When) when that check box is selected ( BillAddressSameAsShipping property is true). By using an Otherwise action after the When action, you can specify another set of data transform actions to take if the check box is not selected.

In the list of rows on the Definition tab, an Otherwise When action row must be preceded by a When action row at some point in the list. An Otherwise action row must be preceded by either a When action row or an Otherwise When action row.

Example

In the following example, if the user selects Billing address same as shipping address check box in the order form, the property BillingAddressSameAsShipping is set to "true". In that case, the data transform actions following the When action specify to update the pyWorkPage.pyWorkParty(Customer).BillingInformation page using the Address value from the pyWorkPage.pyWorkParty(Customer).ShippingInformation page (that is, use the shipping address for the billing address). If the check box is not selected, the children actions of the Otherwise action specify to set the billing information page values to null strings, so that the user has to enter the data.

When pyWorkPage.pyWorkParty(Customer).BillingAddressSameAsShipping == "true"
  Update Page pyWorkPage.pyWorkParty(Customer).BillingInformation with values from pyWorkPage.pyWorkParty(Customer).ShippingInformation
    Set .Address equal to .Address
Otherwise
  Update Page pyWorkPage.pyWorkParty(Customer).BillingInformation
    Set .Address equal to ""

Relationship settings

The When, Otherwise, and Otherwise When actions have no settings for the Relation field.

Supported features

You can use the following items in the rows for the When and Otherwise When actions:

  • When condition rules
  • Expressions
  • Primary keyword

Restrictions

Do not use < or > in an expression. Use <= or >= instead.

  • Previous topic Data Transform form - Update Page action
  • Next topic Configuring the JSON data transforms settings column on the Data Transform form

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