The User Settings allow the user to customize the behavior of the app. You can change the names, types, and other properties of one or more user settings. User settings may be used in expressions (security filters, slice filters, app formulas and initial values, column constraints, format rules, and so on) to control the behavior of the app.
Here are some common use cases for User Settings:
- Your app has data analytics for 10 different countries. Ask the user to select a country using the User Settings, and filter the data (using a security filter or slice) to show just the appropriate information for that country.
- Your app supports more than one language. Ask the user to choose a preferred language using the User Settings, then modify the user interface using
DisplayNameexpressions based on the chosen language.
- Your app is for members of a soccer league to see the upcoming matches for their team. Ask the user to choose their team using the User Settings, and filter the data appropriately.
- Just as in the Display Jobs sample, your app is for members of a team to pick up tasks to work on. Each team member provides an identifier or name using the User Settings, and the app filters the data appropriately.
Access User Settings
To access User Settings:
- Open the app in the editor
- Go to Data and select User Settings under Options in the Data panel.
We've made some improvements to the app editor, currently in preview.
You are opted in to the new editor by default, but you can switch back to the legacy editor at any time.
If you are using the legacy editorGo to Data > User settings.
There are a fixed number of options, each of which is initially hidden. Click Show? to display one or more options, change their names, types, and other properties to control the structure of the user settings for your app. This is identical to the way you refine the column structure of regular tables in the app. You can use many of the same mechanisms: column constraints, initial values, and so on.
Each individual user setting is a row in a hidden table. The columns of this hidden table have the same column features as normal table columns, such as column types, column constraints, app formulas, initial values, and display names. Column values from the user settings table are available within expressions using the
USERSETTINGS() function or
Unlike normal tables, the user settings are stored on the device itself, not in the cloud. Consequently, user settings do not follow the user between devices. If multiple users sign in on the same device, each will have their own user settings, and one user may not access another's user settings. User settings can be used even if not signed in, but will no longer be scoped to a particular user.
The user settings option values are saved in the app on each device or browser in which the app is running. The user settings are unique to each user device. These values persist across restarts of the app.
However, when the app is being run in the emulator within the app editor, user settings (along with all other cached information) are deleted every time the page is refreshed. This allows the app creator to work with a clean state each time the app is run.