Skip to main content
This content is now archived and is no longer updated. Progress is not calculated. Pega Cloud instances are disabled, and badges are no longer awarded. Click here to continue your progress in the latest version.

Default property values

Default values

When a user creates a case, you may want to set default values for properties that are already known. Setting default values can reduce the time users spend entering data. For example, in an insurance claim case, you set the date of loss to default to today's date. 

Other times, you may want to use data from the operator record — such as the user's organization unit — to initiate property values. For example, in a travel booking application, you set the First Name and Last Name to the first and last name on the user operator record. In addition, you set the Date of Travel to today's date and the Date of Return to seven days in the future.

Travel Booking Form

In a development environment, setting default values can also be useful. When you iteratively run a process to test your changes, using a data transform to enter default values in required fields saves time.

pyDefault and pySetFieldDefaults

Pega Platform provides two types of data transforms that are used to automatically set default property values and page properties when you create a case: pyDefault and pySetFieldDefaults

Tip: As a best practice, use pySetFieldDefaults to set values for UI fields, and use pyDefault for properties not referenced in the UI. For example, configure pySetFieldDefaults to set the default value for the Reservation date field on a view to reserve a rental vehicle and configure pyDefault to set the default urgency for assignments for the case type.

The first time you create a view for your case type, Pega Platform creates the pyDefault and pySetFieldDefaults data transforms. You can also create them manually. When a new case is created, the pyDefault data transform is invoked by the pyStartCase process. PyDefault then invokes the pySetFieldDefaults data transform.

pyDefaults and pySetFieldDefaults

For example, in the following image of the pySetFieldDefaults configurations, the First Name (.FirstName) and Last Name (.LastName) fields are set to pyFirstName and pyLastName from the OperatorID clipboard page.

Note: To reference the OperatorID data page, you must add an entry to the Pages & Classes tab. 

For example, in the following image of the pySetFieldDefaults configurations, the Date of Travel (.DateofTravel) field is set to the current date using the @CurrentDateTime() function, and the Date of Return field is set to seven days from the current date using the @addCalendar(.DateOfTravel, "0", "0", "0", "7", "0", "0", "0") function. For more information on these functions, see Functions in Expressions


Check your knowledge with the following interaction.

This Topic is available in the following Modules:

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