Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 0GeCqfi2TaSN7c8QqsZxmx
Power Apps - Building Power Apps
Answered

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

Like (1) ShareShare
ReportReport
Posted on 8 Jun 2022 17:05:00 by 753

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:
  • Greg27 Profile Picture
    753 on 21 Sep 2022 at 09:40:06
    Re: Behavior function in a non-behavior property. You can't use this property to change values elsewhere in the app.

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

  • Syed Ehtisham Ali Profile Picture
    2 on 21 Sep 2022 at 06:28:43
    Re: Behavior function in a non-behavior property. You can't use this property to change values elsewhere in the app.

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

     

  • One Profile Picture
    416 on 16 Jun 2022 at 11:21:24
    Re: Behavior function in a non-behavior property. You can't use this property to change values elsewhere in the app.

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

  • Greg27 Profile Picture
    753 on 16 Jun 2022 at 09:47:52
    Re: Behavior function in a non-behavior property. You can't use this property to change values elsewhere in the app.

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

  • seadude Profile Picture
    1,855 on 15 Jun 2022 at 20:29:37
    Re: Behavior function in a non-behavior property. You can't use this property to change values elsewhere in the app.

    @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
    753 on 08 Jun 2022 at 17:37:41
    Re: Behavior function in a non-behavior property. You can't use this property to change values elsewhere in the app.

    @One 

    Thanks for your help.

  • Verified answer
    One Profile Picture
    416 on 08 Jun 2022 at 17:10:40
    Re: Behavior function in a non-behavior property. You can't use this property to change values elsewhere in the app.

    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!

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,662 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard