cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kinghnvn
Helper V
Helper V

Showing text for two gallery.

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

7 REPLIES 7
PTBBSolutions
Solution Supplier
Solution Supplier

Hi @kinghnvn ,

 

What does the Upcoming and Previous buttons do?

@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

 

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. 

@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
Helper V
Helper V

but it's wrong if I booked an appointment.

kinghnvn_0-1638282583787.png

 

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.

it's working now. thank you so much.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,272)