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 text for two g...
Power Apps
Answered

Showing text for two gallery.

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I have a same text for two gallery (upcoming and pass).

Upcoming tab: there is no appointment it will showing text "No upcoming reservations". That's OK.

kinghnvn_0-1638259499457.png

 

 

Previous tab: there are 3 appointments but it's still showing text "No upcoming reservations"

How can I fix it?

kinghnvn_1-1638258913520.png

 

Thanks.

 

Categories:
I have the same question (0)
  • PTBBSolutions Profile Picture
    691 on at

    Hi @kinghnvn ,

     

    What does the Upcoming and Previous buttons do?

  • kinghnvn Profile Picture
    on at

    @PTBBSolutions 

     

    Please find below code.

     

    UPCOMING button text: "UPCOMING (" & CountRows(gallUpcoming.AllItems) & ")"

    kinghnvn_1-1638265682537.png

    Upcoming button OnSelect: UpdateContext({upSelected:!upSelected});UpdateContext({prevSelected:!prevSelected})

    kinghnvn_2-1638265731551.png

    Previous buttons text: "PREVIOUS (" & CountRows(gallPast.AllItems) &")"

    kinghnvn_3-1638265753484.png

    Previous buttons OnSelect: UpdateContext({prevSelected:!prevSelected});UpdateContext({upSelected:!upSelected});

    kinghnvn_4-1638265774360.png

     

    MyAppts screen Text Visible

    If(CountRows(gallUpcoming.AllItems) >=1, false, true)

    kinghnvn_0-1638265635030.png

     

  • PTBBSolutions Profile Picture
    691 on at

    Hi @kinghnvn ,

     

    Can you try something like this:

    If(
    	upSelected,
    		CountRows(gallUpcoming.AllItems) >=1,
    	If(
    		prevSelected,
    			CountRows(gallPast.AllItems) >=1,
    				false
    		)
    	)

    for the Visible property. 

  • kinghnvn Profile Picture
    on at

    @PT 

     

    I tried the code for the Visible property. 

    The text could not display at UPCOMING but it's still showing at the PREVIOUS screen

    kinghnvn_0-1638282106587.png

     

    just edit code as below. it works fine. thanks.

     

    If(
    upSelected,
    CountRows(gallPast.AllItems) >=1,
    If(
    prevSelected,
    CountRows(gallUpcoming.AllItems) >=1,
    false
    )
    )

     

  • kinghnvn Profile Picture
    on at

    but it's wrong if I booked an appointment.

    kinghnvn_0-1638282583787.png

     

  • Verified answer
    PTBBSolutions Profile Picture
    691 on at

    Hi @kinghnvn ,

     

    I've made a mistake.

     

    Please try below code:

     

    If(
    	upSelected,
    		CountRows(gallUpcoming.AllItems) < 1,
    	If(
    		prevSelected,
    			CountRows(gallPast.AllItems) < 1,
    				false
    		)
    	)

     

    Please accept this as a solution if it works as you expect.

  • kinghnvn Profile Picture
    on at

    it's working now. thank you so much.

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
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 617

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard