JavaScript Parameters
In SAP Customer Data Cloud, JavaScript parameters are small customizations you can make to configure behavior, render UI components like Screen-Sets, and control API calls. They cover initialization (site, data center, language), UI rendering and callbacks, authentication and social provider settings, as well as data submission (profile, consent, custom attributes). By adjusting these settings per use case, you can localize experiences, enforce security policies, and tailor login/registration flows without backend changes.
Using JavaScript parameters, you can:
- Display a UI element (such as a checkbox) only for a specific IP range
- Validate the user's ZIP code according to your own custom logic
- Inject a webservice call when a certain condition is met
- Respond in real time to the user's input
Customer Identity ScreenSets
Building on these parameters, Customer Identity ScreenSets expose event callbacks (like onBeforeSubmitand onAfterScreenLoad) that let you hook into each UI lifecycle step and tailor user interactions in real time. These events are passed as JavaScript callback parameters directly inside the showScreenSet call, allowing you to hook into specific moments of the Screen-Set lifecycle. Here are some events that these screen sets trigger:
- onError
- called when an error occurs
- onBeforeSubmit
- called before a form is submitted
- onSubmit
- called when a form is submitted, can return a value or a promise
- onAfterSubmit
- called after a form is submitted
- onBeforeScreenLoad
- called before a screen is rendered
- onAfterScreenLoad
- called after a new screen is rendered
- onFieldChanged
- called when a field is changed in a managed form
- onHide
- called when a user clicks the "X" (close) button or when the screen is hidden
- onBeforeValidation
- called after a user submits a form and before CDC's built-in field and form validations
Implementing JavaScript Parameters
The video shows configuring JavaScript Parameters in SAP Customer Data Cloud’s UI Builder to customize the Registration screen. It uses the onFieldChanged callback to auto-capitalize first and last names.
Summary
- JavaScript Parameters are name–value options passed to the SAP Customer Data Cloud Web SDK to configure behavior, render UI components, and control API calls.
- Customer Identity Screen-Sets expose event callbacks (such as onBeforeSubmit, onFieldChanged, and onAfterSubmit) that let you hook into UI lifecycle steps and tailor user interactions in real time.
- The onFieldChanged callback was used in the video as a sample application of JavaScript Parameters to auto-capitalize first and last name fields on the Registration screen.