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 / Showing or hding a dat...
Power Apps
Answered

Showing or hding a data card onclick

(0) ShareShare
ReportReport
Posted on by 509

Afternoon all

 

I'm getting back into the swing of PowerApps. A very basic question which I once knew...

 

I have a form with a number of fields. Once the user has filled in the first set of fields I want them to click the 'Next' button to make them visible but for the life of me I can't remember what the formula is? Of course before the 'Next' button is pressed the first set of fields are visible if that makes sense? 
 

Datacard3.png

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    Are you trying to create a 'multi-page' form effect when the next button is clicked which will hide some fields and show others?

     

    I'd suggest this code in the OnVisible property of your screen

    Set(currentPage,1)

     

    Put this code in the OnSelect property of the button

    Set(currentPage, 2)

     

    You also wish to make a goto previous screen button with this OnSelect code.

    Set(currentPage, 1)

     

    For any inputs you want to show on Page1 put this code in the Visible property.

    currentPage=1

     

    For any inputs you want to show on Page2 put this code in the Visible property.

     

    currentPage=2

     

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

     

    @darrenfloyd666

  • sutekh Profile Picture
    509 on at

    Thanks @mdevaney that was just the ticket. That's the solution I'd used before but just couldn't remember it!  

  • sutekh Profile Picture
    509 on at

    Just another question @mdevaney what's the best method for a 3rd and possibly 4th page?

  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @darrenfloyd666 

    Same concept here.  Every datacard/control should have one of these in the Visible property

    currentPage=1
    currentPage=2
    currentPage=3
    currentPage=4

     

    Your Next button should have this code in the OnSelect

    If(currentPage<=3, Set(currentPage, currentPage+1))

     

    And this code in the OnVisible

    !(currentPage=4)

     

    Your button to show previous should have this code in OnSelect

    If(currentPage>=1, Set(currentPage, currentPage-1))

     

    And this code in the OnVisible

    !(currentPage=1)

     

    If this code works well for you it might be a good idea to add it as a 2nd solution so everyone can benefit.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

     

     

  • sutekh Profile Picture
    509 on at

    Thanks @mdevaney worked liked a dream!

  • sutekh Profile Picture
    509 on at

    @mdevaneyquick question. Using the If(currentPage<=3, Set(currentPage, currentPage+1)) 

     

    How would I hide the Next Button when I get to Page 3/the submission page?

     

    Thanks

  • mdevaney Profile Picture
    29,991 Moderator on at
    @Anonymous
    Put this code in the Visible property of the next button:

    !(currentPage=3)

    —-
    Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.
  • sutekh Profile Picture
    509 on at

    Thanks do would it be:

     

    If!(currentPage=3, Set(currentPage, currentPage+1)) 

     

    or would it be just the 'if'

     

    I  need it to appear on 'page' 1 and 2

  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @darrenfloyd666 

    Nope, if you want to hide the button its literally just this code.  No IF statement needed since it evaluates to true/false.

     

    !(currentPage=3)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Linda_M Profile Picture
    3 on at

    Hi 
    I have followed the above steps and its working!! thank you,  However, i am now formatting my "pages" and becoming unstuck.  I have set the columns to 3 and most fields are sitting where i would like them, but a few of them i am unable to move to the correct location.  

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard