How do I setup/register a new app user automatically?
How can I do something automatically the first time a user uses the app?
This example assumes your app requires sign-in, and that you have a table named Users, each row of which describes a single user of your app. Such a table is a common way to store information about your app users and as an alternative to User Settings to store their individual app settings. The Users table is assumed to have a column named Email to store the email address each user uses to sign-in.
The process presented here does not replace the need for signed-in users to be registered as app users in the app editor.
If your app does not require sign-in, the best you can do is automatically detect a new device, which may or may not correspond to an individual user. Without user sign-in, you might have a Devices table instead of a Users table, and should use
CONTEXT("Device") rather than
Create a table or slice with exactly one row to serve as a menu for the new user.
Create a Data: add a row to another table using values from this row action for the table (1) that adds a new row to your user table for the current user if the user is not currently in the user table, with an Only if this condition is true expression like:
Create an App: go to another view in this app action for the table (1) with a Target expression that uses a LINKTO…() function to navigate to a desirable starting view after the user addition.
Create a Grouped: execute a sequence of actions action for the table that performs both actions (2) & (3).
Create a deck, gallery, or table view atop the table or slice (1) for the new user start view.
Set the Row Selected event action for the new user start view (5) to the Grouped action (4).
Set the Starting view in UX >> Options to an expression that directs the user to the new user start view (5) if the current user is not currently in the user table, like:
IF( NOT(IN(USEREMAIL(), Users[Email])), "new-user-start-view", "existing-user-start-view" )
new-user-start-viewwith the name of the new user start view (5), and
existing-user-start-viewwith the name of a view existing users should see first.
Use Show if in all other views to hide them if the current user is not registered, to prevent the unregistered user from bypassing registration.