Since navigate in App OnStart has been disabled in favor of the StartScreen property, how do we do a conditional navigation based on information that is being pulled in the OnStart?
Solved! Go to Solution.
This is what I ended up doing and it works.
If( !IsBlank(LookUp(WordsScore, Title = User().Email).Level), Game, Tutorial)
This note from documentation will clarify your question:
Can you give us more intel about your scenario ?
Hi @JR-BejeweledOne :
As @gabibalaban said the variables and collections created in OnStart are not available in StartScreen property.
At present, only some arithmetic logic in OnStart can be put into StartScreen, for example:
If(YourJudgmentCondition,Screen1,Screen2)
Best Regards,
Bof
I am working on a game. The game is saving the player's level and score to a back end data source. The goal with the start screen is to skip the tutorial and go straight to the game board screen at the level they were at the last time they played if the player has an entry in the data source.
What concerns me about this new way of navigating to the StartScreen, is that depending on their connection they might be taken to an empty game screen while waiting for the OnStart to load. There aren't many and they load quickly but even so, it sort of defeats the purpose of conditional navigation. No one wants to go to a tutorial every time they open a game but it's necessary the first time.
based on your scenario, the following formula used in StartScreen property of the app will be suitable to redirect the user to the right screen:
With({currentUser:User().Email},
If(
LookUp(
ScoreDataSource,
user=currentUser,
true),
GameScreen,
TutorialScreen
)
This is what I ended up doing and it works.
If( !IsBlank(LookUp(WordsScore, Title = User().Email).Level), Game, Tutorial)
User | Count |
---|---|
259 | |
108 | |
95 | |
57 | |
40 |