I have the following statement in the StartScreen of my app:
Set(varStudentName, User().FullName)
It is giving me the following message:
Behavior function in a non-behavior property. You can't use this property to change values elsewhere in the app.
Why would I be getting this? I have the same statement in another app and I receive no messages, but where else am I supposed to set a variable name?
@Shan_kazmi1 As the resolution shows, move the code from the StartScreen property and put it in the OnStart property.
i have this type of issue how can I resolve this issue.
@seadude ,
I don't currently have the time to test that out, but theoretically that should work as long as you are setting variables for the screen name you want to use in the onstart property, then pass them to the startscreen property as the screen to be navigated to. you will need to delegate the actions properly by putting behavior functions in the onstart property.
I would open that up as a new request. I am really new to Power Apps, but it seems like a really good question. If you do, would you tag me on it as I would love to know the answer.
@One and @Greg27 , what do you make of this one?
Scenario:
- Deep-link opens the PowerApp
- Has a `screen` parameter appended to the URL
- Example:
- Need the PowerApp to look at the `screen` Param() and Navigate() to correct screen
Tried: Placing the following code 3 different places, each with its own ERROR!
If(
!IsBlank(Param("screen")),
Switch(
Param("screen"),
"work", Navigate(scrWork, Fade)
),
Navigate(scrHome, Fade)
)
- OnStart:
- ERROR: Navigate is not permitted in OnSTart. Use the StartScreen property instead.
- StartScreen:
- ERROR: Behavior function un an non-behavior property. You can't use the property to change values elsewhere in the app.
- OnVisible of the first screen (scrHome):
- ERROR: Navigate cannot be used here since it would automatically always navigate away from this screen.
- The error is incorrect by the way! The else statement runs contrary to the statement.
So... how then, should a deep link be passed to a PowerApp?
Thanks for your help.
Hi @Greg27,
You will want to move that line of code to the OnStart property to initialize the variable. StartScreen is basically just a simplified way of saying "On Start of the application, navigate to this screen", whereas OnStart is an actual trigger for events like setting variable, creating collections, etc.
------------------------------------------------------------------------------------------------------------------------------
Please click "Accept as Solution" if this post answered your question so that it is helpful for people having similar questions. If you found this post helpful smack that Thumbs up button! Thanks!
MS.Ragavendar
27
mmbr1606
14
Super User 2025 Season 1
EE-04041031-0
11