This documentation explains how to create transformation scripts in Planning and link them to forms for data validation and transformation when saving form data.
Access to Planning application
Appropriate permissions to create transformation scripts and build forms
Knowledge of JavaScript for writing transformation code
Navigate to the Transformation Script section in Planning for creating new transformation scripts.
Click on the "Create New" button to begin creating a new transformation script.
Name : Enter a descriptive name for your transformation script (required)
Description : Provide a brief description explaining the purpose of the script (required)
Select Data Sources : Add one or more views as data sources
Click the dropdown to select an available view (e.g., "SalesView")
Set an alias for each view (e.g., "sales")
Use the "+" button to add additional data sources as needed
Click the "Add Data Source" button to include more data sources if required
Choose a target data source from the dropdown where the transformed data will be saved.
Write JavaScript code to transform the data. Your code should:
Process data from the source views using their aliases
Perform any necessary validations or transformations
Return the final data structure to be saved
After completing all required fields and writing your transformation code, click the "Save" button.
Navigate to the Form Builder section in EAConnect.
In the form builder screen, locate the left panel containing form configuration options:
Form Name : Enter or verify the name of your form (e.g., "Test Transformation Script")
Select Team : Choose the appropriate team from the dropdown (e.g., "public")
Datasource : Select the data source to be used by the form
Refer to Form Documentation for detail configuration
Locate the "Transformation Script" section in the form settings
Click on the dropdown field to see available transformation scripts
Select the transformation script you want to link to this form (e.g., "Test2" as shown in the screenshot)
Finish configuring your form with the necessary fields, layout, and other settings.
Save your form configuration after linking the transformation script.
When a user edits and saves data in the linked form:
The linked transformation script will automatically execute
The script will validate and transform the form data according to your code
Validation errors can prevent form submission if conditions are not met
Transformed data will be saved to the specified target data source
Transformation scripts are only executed when a form with the linked transformation is saved
The script can access data from all configured data sources
You can perform both validation (preventing saves if conditions are not met) and transformation (modifying data before saving)
Complex validations and business rules can be implemented in the transformation script