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
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:
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:
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()
}
)
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:
Best regards,
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
209 | |
194 | |
82 | |
58 | |
38 |
User | Count |
---|---|
303 | |
249 | |
120 | |
83 | |
55 |