Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Press a button upon landing on the screen

(0) ShareShare
ReportReport
Posted on by 228

I have a home page with a button that navigates to another screen with a button that when pressed certain cards become visibled. The default view of the form should be the results of pushing the button. The current code from the button on the homepage is this:

Navigate(ScreenNCANew,ScreenTransition.Fade); ResetForm(NCAForm_2); Select(ScreenNCANew!Name=NCAGeneralInfo_2)

 

ChatGPT gave me that code but it's not working. I have tried other things but the form still comes up blank.

 

All of the fields that should appear by default, all have the following code on the visible property: NCAGeneralInfo_2.DisplayMode=DisplayMode.Disabled. The NCAGeneralInfo_2 is the button that should be pressed upon navigating to the screen.

 

If there is another approach to doing this? I'm totally open to it. My goal is to make some fields visible when a particular button is pushed and other fields visible when another button is pushed.

Categories:
  • SeavinUfes Profile Picture
    4 on at
    Re: Press a button upon landing on the screen

    I think i can help you...

     

    If the screen needs to launch with a button pressed as default, just go to the "OnVisible" propriety and set the formula: Select(button_name). Just that!

  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at
    Re: Press a button upon landing on the screen

    Sorry, I still don't understand the scenario.  The default view should only be viewed when the button is actively pressed?  Or the default view should be navigated to (via the Tab button) when the button is pressed?

  • ShondaT Profile Picture
    228 on at
    Re: Press a button upon landing on the screen

    @Rusk 

     

    I didn't explain it very well. 

     

    I have a "tab" called General which is a button. That button, when pressed, should be the default view when users land on the screen. That means the button has to be pressed upon navigating to the screen. What code do I need to put on the button that navigates from the home screen to the screen containing the General button that would "Press" the button?

     

    this is the code that is currently on the button on the home screen: 

     

    Navigate(ScreenNCANew,ScreenTransition.Fade); ResetForm(NCAForm_2); Select(ScreenNCANew!Name=NCAGeneralInfo_2)

     

    The last part was supposed to "select" or "press" the button which is called "NCAGeneralInfo_2". I have tried various codes that seem to only render the button unPressed.

     

    I hope that's more clear. Thanks for your time.

  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at
    Re: Press a button upon landing on the screen

    I'm not sure what that Navigate formula is trying to do, but for your question regarding "make some fields visible when a particular button is pushed and other fields visible when another button is pushed" you can use a variable.

     

    Here's an example for Button1 OnSelect:

    Set(varButton1,!varButton1)

     

    Visible property of your field:

    varButton1

     

    When Button1 is pressed, it toggles the variable "varButton1" to true or false.  And the visible property of the field also toggles to true or false at the same time.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

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,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard