web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Behavior function in a...
Power Apps
Answered

Behavior function in a non-behavior property. You can't use this property to change values elsewhere in the app.

(1) ShareShare
ReportReport
Posted on by 776

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?

Categories:
I have the same question (0)
  • Verified answer
    One Profile Picture
    416 on at

    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!

  • Greg27 Profile Picture
    776 on at

    @One 

    Thanks for your help.

  • seadude Profile Picture
    1,855 on at

    @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: 

    ms-apps:////providers/Microsoft.PowerApps/apps/<my_app_id>?screen=scrWork

    - 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.

    seadude_0-1655321823305.png

    - StartScreen:

        - ERROR: Behavior function un an non-behavior property. You can't use the property to change values elsewhere in the app.

    seadude_1-1655324776910.png

    - 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.

    seadude_2-1655324851680.png

     

    So... how then, should a deep link be passed to a PowerApp?

  • Greg27 Profile Picture
    776 on at

    @seadude 

    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 Profile Picture
    416 on at

    @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.

  • Syed Ehtisham Ali Profile Picture
    2 on at

    i have this type of issue how can I resolve this issue.

     

  • Greg27 Profile Picture
    776 on at

    @Shan_kazmi1 As the resolution shows, move the code from the StartScreen property and put it in the OnStart property.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 516

#2
WarrenBelz Profile Picture

WarrenBelz 428 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 292

Last 30 days Overall leaderboard