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

booking something using calendar and excel

Hello,

im trying to make a feature that will book a car using calendar. the concept is, when i select the date for example today it will show the available cars, the cars for example is 5. and then when i submit it the cars will decrease by 1 but the cars for tomorrow is still 5. any ideas how to make it ? 

Thank you

1 REPLY 1
Community Support Team
Community Support Team

Re: booking something using calendar and excel

Hi @AdhamFH ,

Based on the needs that you mentioned, I think PowerApps could achieve your needs. According to the needs that you mentioned, I think a Date Picker control and a Gallery control could achieve your needs in your scenario.

 

On your side, you could consider create a blank app, then add a Date Picker control (DatePicker1), and a Gallery control as below:

1.JPG

Then you need to set up available Cars collection within your app, which would store the available cars for each day. Please consider set the OnStart property of the App to following:

 

ClearCollect(
             CarsCollection, 
             {CarNo: "1001", CarName: "Car1"}, 
             {CarNo: "1002", CarName: "Car2"},
             {CarNo: "1003", CarName: "Car3"},
             {CarNo: "1004", CarName: "Car4"},
             {CarNo: "1005", CarName: "Car5"}
)

 

Within your Excel table, you need to add columns to record the Booked car name, Booked date (date type column), Booker and Booked Car No. The data structure of your Excel table should be as below:

2.JPG

add your Excel table as data source into this app.

 

Within your app, set the Items property fo the Gallery to following:

 

Filter(
       CarsCollection,
       Not(CarName in Filter(YourExcelTable, Text(BookedDate, "yyyymmdd") = Text(DatePicker1.SelectedDate, "yyyymmdd")).CarName) // BookedDate is a date type column in your Excel table
)

 

Add a "Book" icon button within the Gallery, set the OnSelect property to following:

 

Patch(                                // Patch the booked card record into your Excel table
      YourExcelTable,
      Defaults(YourExcelTable),
      {
         CarNo: ThisItem.CarNo,
         CarName: ThisItem.CarName,
         Booker: User().DisplayName,
         BookedDate: Today()
      }
)

 

3.JPG

Within your Excel table, you could see that which user booked which car on a specific day.

Please consider take a try with above solution, then check if the issue is solved.

 

More details about the Patch function in PowerApps, please refer to the following article:

Patch function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,160)