FirstScreen property

App.FirstScreen — Screen

The first screen displayed when the app is launched. If not set, the first screen set in the app designer is used.

Users can't "go back" from the first screen they see. If you have defined several screens that come before that first screen in the app designer, those are not accessible by pressing Back in the app. However, you can use a go forward button to let users reach those screens.

Using launch options

Launch options enable an app to adapt to its context, including its host page if it's embedded. Launch options are set using the app's address. Assume that a text launch option is defined, Client.

Use a formula like the following to use a special first screen if the client is Acme:

IF(App.LaunchOptions!Client = "Acme", AcmeScreen)IF(App,LaunchOptions!Client = "Acme"; AcmeScreen)

Using the tag of the signed-in user

For private apps, the USERHASTAG function can be used to determine if a certain tag is associated with the signed-in user. This formula presents different screens for employees versus contractors:

IF(USERHASTAG("Employee"), EmployeeScreen, USERHASTAG("Contractor"), ContractorScreen)IF(USERHASTAG("Employee"); EmployeeScreen; USERHASTAG("Contractor"); ContractorScreen)

Use NextScreen on both screens to merge users back to a common second screen, keeping the rest of the experience unified.

Using the email address of the signed-in user

If you don't use tags, check the user's email address instead:

IF(ENDSWITH(App.UserEmailAddress, "@ourcorp.com"), EmployeeScreen, ContractorScreen)IF(ENDSWITH(App,UserEmailAddress; "@ourcorp.com"); EmployeeScreen; ContractorScreen)

This shows EmployeeScreen for company email addresses and ContractorScreen for everyone else.

Using saved field values

Persistent fields remember their values between sessions. To determine the first screen based on a value entered by the user, simply access the field value as you normally would from a formula.

Hiding the back end of an app

There may be parts of your app that should not be shown to users, such as hidden fields used purely for calculations or named values representing columns in database tables.

Make these part of a form screen that comes before the first screen of the app, ensuring that they are never seen. You could even use a list screen to organize the hidden parts of your app.

Examples

IF(App.LaunchOptions!Debug, DebugScreen, MainScreen)IF(App,LaunchOptions!Debug; DebugScreen; MainScreen)

Sets the first screen to DebugScreen if the Debug launch option is set to TRUE, or sets MainScreen as the first screen otherwise.

IF(USERHASTAG("Administrator"), SettingsScreen, DefaultScreen)IF(USERHASTAG("Administrator"); SettingsScreen; DefaultScreen)

Sets SettingsScreen as the first screen if the administrator is signed in and DefaultScreen for all other users. This formula requires that the app is a private app and uses the tag of the signed-in user.

IF(App.UserEmailAddress = "admin@example.com", SettingsScreen, DefaultScreen)IF(App,UserEmailAddress = "admin@example.com"; SettingsScreen; DefaultScreen)

Sets SettingsScreen as the first screen if the administrator is signed in and DefaultScreen for all other users. This formula requires that the app is a private app and uses the email address of the signed-in user.