web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Building an app for bo...
Power Apps
Answered

Building an app for booking cars

(0) ShareShare
ReportReport
Posted on by 159

Hello,

I try to build an app for car booking for my colleagues. We have 3 spare cars that are used for all the company when it's need.

This cars must be book by two fields: date and time of reception and date and time of return the car. If one person book one car , that car cannot be book in that interval... cars can be book for several hours or multiple days...

I don't have clear ideas for start. Maybe someone can give a hint or an idea.

 

Thank you 

Categories:
I have the same question (0)
  • BCLS776 Profile Picture
    8,994 Moderator on at

    Here's a suggestion: before you go through the effort of building an app, why not try the built-in calendar functionality in Microsoft 365? You create a "Resource" for each car, and then it gets its own calendar. If that works for your team, then you're all set. If you need more functionality than that, then consider taking it further with an app.

     

    Hope that helps,

    Bryan

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @ciprianpopovici,

    Do you want to create a car booking system?

    Could you please share a bit more about your need?

     

    Actually, you should prepare a SharePoint list including the Car(Choice), ReceptionTime(Date and time) and ReturnTime(Date and time).

    Note that you need to make the Car field Required so that each user must select a car before he create a request.

    vqiaqimsft_0-1636617372605.png

    You could generate an app directly based on the data source as below:

    vqiaqimsft_1-1636617530902.png

    Then you could get an app with three different screens:

    vqiaqimsft_2-1636617579558.png

    Set the OnSelect property of the submit button as below:

    If(
     !(DataCardValue8.Selected.Value in Concat(
     Filter(
     Actions,
     And(
     DateValue1.SelectedDate + Time(
     Value(HourValue1.Selected.Value),
     Value(MinuteValue1.Selected.Value),
     0
     ) >= ReceptionTime,
     DateValue1.SelectedDate + Time(
     Value(HourValue1.Selected.Value),
     Value(MinuteValue1.Selected.Value),
     0
     ) < ReturnTime
     ) || And(
     DateValue2.SelectedDate + Time(
     Value(HourValue2.Selected.Value),
     Value(MinuteValue2.Selected.Value),
     0
     ) > ReceptionTime,
     DateValue2.SelectedDate + Time(
     Value(HourValue2.Selected.Value),
     Value(MinuteValue2.Selected.Value),
     0
     ) <= ReturnTime
     ) || And(
     DateValue1.SelectedDate + Time(
     Value(HourValue1.Selected.Value),
     Value(MinuteValue1.Selected.Value),
     0
     ) <= ReceptionTime,
     DateValue2.SelectedDate + Time(
     Value(HourValue2.Selected.Value),
     Value(MinuteValue2.Selected.Value),
     0
     ) >= ReturnTime
     )
     ).Car,
     Car.Value,
     ","
     )),
     SubmitForm(EditForm1),
     Notify(
     "Already reserved!",
     Error
     )
    )

    Note that the 'Actions' is my data source and the DataCardValue8 represents the Combo Box corresponding to the Car field in your SP list.

    DateValue1, HourValue1, MinuteValue1 separately represents the Date Picker and hour picker and minute picker as below:

    vqiaqimsft_3-1636617932593.png

     

    Here is a demo, you could check the attachment for details.

     

     

     

     

     

  • ciprianpopovici Profile Picture
    159 on at

    Super!! Oau!!!  What a great explanation. I will test your solution and give you a feedback. Thank you

  • Verified answer
    ciprianpopovici Profile Picture
    159 on at

    Hello, thanks for the solution. I tested and it's working.  If it's not too much i have a little modification in my list, the field Car (car number) in the Sharepoint List it's a text box, and in the PowerApps i changed to a combox with the values from a collection  with car numbers from another list. Below are the data. I don't know how to change the fields in the code you send me , to make it work. can you help me?

    Thank you

     

     

    ciprianpopovici_0-1637011866142.png

    ciprianpopovici_2-1637012044615.png

     

     

    On screen visible i put the code for collect, and collect the numbers from the Sharepoint List with the car numbers

     

    ciprianpopovici_1-1637011972791.png

     

     

     

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @ciprianpopovici

    Do you want to populate the Combo Box with the CarNumber from another list?

     

    You just need to modify as the note says:

    If(
     !(DataCardValue8.Selected.CarNumber in //Here you should replace the Value with CarNumber from your collection//
     Filter(
     Actions,
     And(
     DateValue1.SelectedDate + Time(
     Value(HourValue1.Selected.Value),
     Value(MinuteValue1.Selected.Value),
     0
     ) >= ReceptionTime,
     DateValue1.SelectedDate + Time(
     Value(HourValue1.Selected.Value),
     Value(MinuteValue1.Selected.Value),
     0
     ) < ReturnTime
     ) || And(
     DateValue2.SelectedDate + Time(
     Value(HourValue2.Selected.Value),
     Value(MinuteValue2.Selected.Value),
     0
     ) > ReceptionTime,
     DateValue2.SelectedDate + Time(
     Value(HourValue2.Selected.Value),
     Value(MinuteValue2.Selected.Value),
     0
     ) <= ReturnTime
     ) || And(
     DateValue1.SelectedDate + Time(
     Value(HourValue1.Selected.Value),
     Value(MinuteValue1.Selected.Value),
     0
     ) <= ReceptionTime,
     DateValue2.SelectedDate + Time(
     Value(HourValue2.Selected.Value),
     Value(MinuteValue2.Selected.Value),
     0
     ) >= ReturnTime
     )
     ).Car),//Here you should delete the Concat() function//
     SubmitForm(EditForm1),
     Notify(
     "Already reserved!",
     Error
     )
    )

     

  • ciprianpopovici Profile Picture
    159 on at

    Thank you, your solution it's working.

    All the best!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This is 120% brilliant. I am still struggling to understand the whole thing with the Concat, but it works like a charm 💪

     

    /Frank

    Denmark

  • alessandro_rd Profile Picture
    2 on at

    First of all, I would like to congratulate you for the solution. However, I have an observation, when I try to edit the record the message appears: "Already reserved!". What is your suggestion to fix this?

  • MarcHS Profile Picture
    2 on at

    Hello,
    thank you very much for your help!
    I would like that a vehicle is automatically added to the booking and not the user does it himself.
    I have tried the following:

    MarcHS_4-1674210706505.png

     

    MarcHS_0-1674210420795.png

    The vehicle list:

    MarcHS_6-1674210911794.png

     

    The booking list

    MarcHS_5-1674210736941.png

    The license plate number (DE: Kennzeichen) from the vehicle list should be selected when the vehicle is free for the particular booking and added to the "License plate number" line.

     

    However, the vehicle is selected which is already booked and not which is free. I think this is because of the "=".
    If I change it to "<>" then no vehicle is selected. I think it is because of the "LookUp", because it compares only the first elements. Is there another function for this?

    Thanks a lot!


    Source code:
    LookUp(Test.Car; Car.Value = LookUp(Test;
    And(
    DateValue1.SelectedDate + Time(
    Value(HourValue1.Selected.Value);
    Value(MinuteValue1.Selected.Value);
    0
    ) >= ReceptionTime;
    DateValue1.SelectedDate + Time(
    Value(HourValue1.Selected.Value);
    Value(MinuteValue1.Selected.Value);
    0
    ) < ReturnTime
    ) || And(
    DateValue2.SelectedDate + Time(
    Value(HourValue2.Selected.Value);
    Value(MinuteValue2.Selected.Value);
    0
    ) > ReceptionTime;
    DateValue2.SelectedDate + Time(
    Value(HourValue2.Selected.Value);
    Value(MinuteValue2.Selected.Value);
    0
    ) <= ReturnTime
    ) || And(
    DateValue1.SelectedDate + Time(
    Value(HourValue1.Selected.Value);
    Value(MinuteValue1.Selected.Value);
    0
    ) <= ReceptionTime;
    DateValue2.SelectedDate + Time(
    Value(HourValue2.Selected.Value);
    Value(MinuteValue2.Selected.Value);
    0
    ) >= ReturnTime
    )
    ).Car.Value)

     

  • Ragnark Profile Picture
    10 on at

    Hi @v-qiaqi-msft I have prepare a Share point List including the Car(Choice), ReceptionTime(Date and time) and ReturnTime(Date and time). I am not sure if I've done it wrong as its not linking . Could you help me with this or show illustration on how you did it.

     

    Any help will be much appreciate.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard