Understanding Citizen Access Page Flow Scripts

When a citizen uses Citizen Access to create an application, Citizen Access creates a temporary record in the Civic Platform database and Citizen Access stores application information in a capModel object. Citizen Access stores capModel object data in memory for the duration of a user’s session.

The capModel object contains all the details about the application. As the user progresses through the forms on each Citizen Access page, Citizen Access updates the capModel object data in memory. Upon completion and submittal of the application, Citizen Access passes the capModel object data to Civic Platform and Civic Platform creates a new record in the Civic Platform database.

You can use Expression Builder of page flow scripts to apply advanced business rules for Citizen Access applications. If you need to populate data on an Citizen Access form, try to use Expression Builder. If you need to populate data not displayed in Citizen Access, use page flow scripts.

Unlike Civic Platform scripts, page flow scripts associate with events from the Citizen Access Page Flow Admin tool. The user triggers page flow scripts when they navigate through different Citizen Access pages. You can associate a script to the following three page flow events:

  • Onload – triggers when the page loads

  • Before – triggers when the user clicks the continue button, it can prevent the user from progressing if data validation fails

  • After – triggers when the user clicks the continue button, can implement automation in the application process

Civic Platform master scripts interact with record data that Civic Platform stores in the database. The Civic Platform master scripts do not work on Citizen Access page flow data.

For example, the editAppSpecific master script function updates an ASI field on the database record, but does not update the Citizen Access capModel object data stored in memory. The Citizen Access capModel object data overwrites the ASI field on the database record when Citizen Access submits a completed application.