NextScreen property

Navigator.NextScreen — Screen

Special value available in formulas:

Item

Navigator

The navigator this property is part of, enabling multiple checked items in the app designer to share the same formula and be updated all at once.

Consider the fields Field1 and Field2, which should only be considered to be valid if their values are greater than 4. Without using the Item value, the Valid property of Field1 would need to use the formula Field1 > 4Field1 > 4 and the Valid property of Field2 would need to use the formula Field2 > 4Field2 > 4.

Using Item, both formulas can read Item > 4Item > 4. This is useful if you have many fields and you want to be able to update their formulas all at once. To do so, click their check boxes in Calcapp Creator and make sure that a checked field is selected. Then, when you update a formula for one checked field, you update all the other checked fields too, which is a great timesaver.

Use Item in exactly the same way you'd use the regular name. Navigator1.VisibleNavigator1,Visible and Item.VisibleItem,Visible are equivalent, for instance.

The screen that appears when the user activates the navigator.

By determining what screen to show using a formula, you can do things like show a screen collecting supplemental information, or even show a warning screen, and make that decision based on data entered by the user. Multiple navigators can also direct users to the same screen (see below).

If this property is not set, it returns the screen which naturally follows this screen (as set in Calcapp Creator).

Use the Visible property to prevent users from activating a navigator by hiding it.

Multiple navigators can share the same screen

Sometimes, it is desirable for multiple navigators to direct users to the same screen and then have that screen detect the choice made by the user. A list screen, for instance, could consist of a large number of product choices in the form of navigators, with the single form screen following the list screen displaying pricing information for the selected product. There could even be many list screens preceding a single form screen, with the form screen displaying information relevant to all the choices the user made.

To make multiple navigators direct users to the same screen, associate a formula with the NextScreen property of the navigators. This formula typically only contains the name of the desired screen, though you're free to add dynamic behavior too (using functions like IF).

Detecting the selected navigator from a formula

The key to enabling multiple navigators to share the same form screen is to make the screen aware of the choice made by the user. To achieve this, make use of the ActiveNavigator property from the form screen's formulas.

Let's say that three navigators, with the labels Product A, Product B and Product C, are part of the list screen named ProductChoice. If you accept the names that Calcapp Creator assigns navigators automatically, their names are ProductA, ProductB and ProductC (without any spaces).

The following formula returns TRUE only if ProductA has been selected:

ProductChoice.ActiveNavigator = ProductChoice!ProductAProductChoice,ActiveNavigator = ProductChoice!ProductA

To make the title of the form screen reflect the choice made by the user, assign this formula to the Label property of the screen:

ProductChoice.ActiveNavigator.LabelProductChoice,ActiveNavigator,Label

Let's say that ProductA costs $10, ProductB costs $20 and ProductC costs $30. To have the form screen display the price of the selected product, associate the following XLOOKUP formula with the Value property of a number field that is part of the form screen:

XLOOKUP(ProductChoice.ActiveNavigator.Label, { "Product A", "Product B", "Product C" }, { 10, 20, 30 })XLOOKUP(ProductChoice,ActiveNavigator,Label; { "Product A"; "Product B"; "Product C" }; { 10; 20; 30 })

The following SWITCH formula produces the same result:

SWITCH(ProductChoice.ActiveNavigator, ProductChoice!ProductA, 10, ProductChoice!ProductB, 20, ProductChoice!ProductC, 30)SWITCH(ProductChoice,ActiveNavigator; ProductChoice!ProductA; 10; ProductChoice!ProductB; 20; ProductChoice!ProductC; 30)

Examples

IF(MainScreen!Result < 20, SuccessScreen, FailureScreen)IF(MainScreen!Result < 20; SuccessScreen; FailureScreen)

Shows the screen SuccessScreen when the user activates the navigator only if the value of the number field Result (which is part of the form screen MainScreen) is less than 20. Otherwise, the screen FailureScreen is shown.

IF(AND((MainScreen!Field1:MainScreen!Field5).Valid), SuccessScreen, FailureScreen)IF(AND((MainScreen!Field1:MainScreen!Field5),Valid); SuccessScreen; FailureScreen)

Shows the screen SuccessScreen when the user activates the navigator only if all fields in the range MainScreen!Field1:MainScreen!Field5MainScreen!Field1:MainScreen!Field5 are valid. Otherwise, the screen FailureScreen is shown. The range includes the two fields Field1 and Field50 (which are part of the screen MainScreen) and all fields that appear between them.

The formula (MainScreen!Field1:MainScreen!Field5).Valid(MainScreen!Field1:MainScreen!Field5),Valid returns a logical array with the same number of elements as there are fields in the MainScreen!Field1:MainScreen!Field5MainScreen!Field1:MainScreen!Field5 range, like this array: { TRUE, FALSE, TRUE, TRUE, FALSE }{ TRUE; FALSE; TRUE; TRUE; FALSE }. The AND function returns TRUE only if all elements of the array are TRUE.

IF(MainScreen!HasCouponCode, CouponCodeScreen, FinalScreen)IF(MainScreen!HasCouponCode; CouponCodeScreen; FinalScreen)

Shows the screen CouponCodeScreen when the user activates the navigator only if the value of the switch field HasCouponCode (which is part of the form screen MainScreen) is TRUE (indicating that the user has toggled it to its "on" position). Otherwise, the screen FinalScreen is shown.

FormScreen1FormScreen1

Shows the screen FormScreen1 when the user activates the navigator. Multiple navigators can associate this formula with their NextScreen properties, enabling several navigators to direct the user to the same screen. FormScreen1 may access the relevant list screen's ActiveNavigator property from their formulas to determine which navigator was selected. (See the main text for examples.)