When designing your screens, you can create an action that is executed before the screen is rendered; this action is called a Screen Preparation. Typically, it includes the preparation of variables, queries to the database, etc.; in fact, all the logic that must be interpreted before the screen is displayed.

How to create a Screen Preparation:

  1. In the eSpace tree, under the Logic layer, right-click on the screen and select Add Screen Preparation.

  1. Service Studio automatically opens the action flow on the Content Canvas. Design the behavior of the screen preparation.

Flow of a Screen Preparation

You have a specific editor to design Screen Preparation behavior, that is, its action flow. In this editor, you can select any tool available in the Action Flow Toolbox to be executed in the action flow of your Screen Preparation.

Flow of a Web Screen and Email Screen Preparation

In Web Screens, the Screen Preparation may execute in one of two situations:

A Web Screen is loading when it's being entered from:

Therefore, if there is logic that you exclusively want to execute when the screen is loading (for example, a query to fetch records to display in the screen), you must explicitly test this situation using the built-in function IsLoadingScreen.

On the other side, when the screen preparation is executed after a screen action flow that ended with an End element, all the elements in your scope keep their value.

As in SMS screens the screen is always loaded before rendering, this section does not apply.

In most cases, the screen preparation action flow terminates with an End element. You can have more than one End element in the action flow, for visualization purposes. In some situations, you may want to, based on some logic, redirect the flow to a different screen by using a Destination element.

Screen Preparation Scope

When editing expressions in your screen preparation flow, you have access to the following elements in the scope:

Anyway, when you're editing your screen preparation flow, all the elements available in the scope are present in the Scope tree of the Expression Editor, in a case where you're editing an expression; or in a case where the variables tree of the Select Variable window, in case you're trying to use a variable.

Executing a Screen Preparation

The Screen Preparation is executed automatically, therefore, you don't have to explicitly invoke it. However, if you are executing your screen action using Ajax the Screen Preparation is not executed when the action flow ends with an End.

After executing the Screen Preparation, the screen starts rendering.

See Also

About Actions | Create a Screen Action | Action Flow Editor