cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Biisorte
Level: Powered On

Problem with variables in Gallery

Good evening,

 

I'm new with Power Apps and I'm trying to build an App to reserve 8 cards per hours. There is no problem with one card, but I don't know how to do it with 8 cards.

I have a Gallery with the hours (the items) and an Excel to store the Bookings.

 

This is my App for 1 card:

 

OnSelect:

Patch(ReservesDir; Defaults(ReservesDir); {Usuari: TextInput1.Text; DiaReserva: Text(DatePicker1.SelectedDate; "[$-es-ES]yyyy-mm-dd"); HoraReserva: ThisItem.Value})

 

DisplayMode:

If(IsEmpty(Filter(ReservesDir; DiaReserva = Text(DatePicker1.SelectedDate; "[$-es-ES]yyyy-mm-dd") && HoraReserva = ThisItem.Value)); DisplayMode.Edit; DisplayMode.Disabled)

 

Text:

If(Button1.DisplayMode=DisplayMode.Disabled; "Reserved"; "Free")

 

I send attached an image of the App.

 

Can anybody help me? I don't know how to do it for 8 cards, and reply the same for every item (every hour) in the Gallery.

 

Thank you very much.

4 REPLIES 4
summitb
Level 8

Re: Problem with variables in Gallery

Not really clear what you mean by 8 cards but I assume you want to ForAll(gallery.AllItems, Patch { ...................... }). If you want to do any action automatically use recurrence in Flow.

Biisorte
Level: Powered On

Re: Problem with variables in Gallery

Many thanks for your response, summitb.

 

What I mean is that in my organization there are 50 people and we have 8 cards for going to the gym. Anybody Can take a gym card without any restriction but we want to build an App for booking these cards in advance.

 

I'll try what you told me.

 

Thank you.

Biisorte
Level: Powered On

Re: Problem with variables in Gallery

It doesn't work 😞

summitb
Level 8

Re: Problem with variables in Gallery

I have done something similar in my case it was scheduling appointments and for each hour there were 15 slots.

 

The workflow was like following,

Show a gallery showing the timeslots.

HourSlotsAction
11AM-12PM5 slots leftBook Now
12PM-1PM5 slots leftBook Now
1PM-2PM5 slots leftBook Now

When you click book now, you can open a new form and create a booking record for that. Count the number of bookings in the above table and if it's above 8 slots. Keep the book bow button disabled.

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,422)