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

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
Highlighted
Community Support
Community Support

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
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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