Skip to main content
Verify the version tags to ensure you are consuming the intended content or, complete the latest version.

Data Transforms and default values

Data Transforms in Pega Platform™ convert source data in one format or class into target data of another format or class. Data Transforms are used to initialize, manipulate, map and transform data associated with a Case. In Dev Studio, you can call Data Transforms from a Process flow. You can also use Data Transforms to set default values for a property.

Note: For more information about Data Transforms and their configuration in App Studio, see Data Transforms.

Calling Data Transforms in flows

By opening a Process in Dev Studio, you can call a Data Transform from a flow. In a flow, click the connector to open the Connector properties window. In the Set properties section, select Apply Data Transform as shown in the following figure:

Apply data transform in a flow rule

Consider another example. An auto repair parent Case has a child Case that manages providing the necessary repairs. The child Case contains a menu of possible items and available services, including unit costs. The items and services that are provided are copied to the parent Case for invoicing. Use a Data Transform to iterate over the list of possible items and services and copy only those entries with a quantity greater than zero. The auto repair Case example is displayed in the following figures:

An auto repair parent case and service child case uses a data transform

Data Transforms for default property values

The Data initialization page updates the pyDefault Data Transform. It is best practice to use the Data initialization page when possible and use the pyDefault Data Transform for more complex default values. The first time that you create a View for your Case Type, Pega Platform creates the pyDefault and pySetFieldDefaults Data Transforms. When you create a new Case, the pyDefault Data Transform is invoked to set the default values for that Case.

Note: The pyDefault Data Transform invokes the pySetFieldDefaults Data Transform. The pySetFieldDefaults Data Transform is modified by the system when Views are being configured. System Architects should not modify the pySetFieldDefaults Data Transform as changes applied by the system during View configuration risk overwriting these changes.

In the App Explorer, access pyDefault and pySetFieldDefaults Data Transforms as shown in the following figure:

pyDefaults and pySetFieldDefaults

For example, in the following image of the pyDefault configurations, the First Name (.FirstName) and Last Name (.LastName) fields are set to pyFirstName and pyLastName from the OperatorID Clipboard Page:

pySetFieldDefaults-first-last-names

To reference the Data Page in the example above, you must add an entry to the Pages & Classes tab. The following image displays OperatorID Data Page added in the Pages & Classes tab:  

pySetFieldDefaults-pages-and-classes

Expressions can also be used to set a value in a Data Transform. For example, in the following image of the pyDefault configurations, the Date of Travel (.DateofTravel) field is set to the current date by using the @CurrentDateTime() Function, and the Date of Return field is set to seven days from the current date through the @addCalendar(.DateOfTravel, "0", "0", "0", "7", "0", "0", "0") Function:

Note: For more information on these Functions, see Building Expressions with Expression Builder.
pySetFieldDefaults-travel-return-dates.png

 

Check your knowledge with the following interaction:


This Topic is available in the following Module:

If you are having problems with your training, please review the Pega Academy Support FAQs.

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 Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice