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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Book parking / reserva...
Power Apps
Unanswered

Book parking / reservation app

(0) ShareShare
ReportReport
Posted on by

Hi all, 

 

That's my very first PowerApps creation today, And I have an issue (if it is ;))

 

So my need : 

Create an app to allow employees to book parking - Only 10 cars can use this parking per day. 

 

What I do: 

I created a SP list with a "name" column and a "reservation date" column

 

On PowerApps, I have my form with two questions (from the SP list), and I added a personalize field with a button on it to validate (cf picture) the form.

 

But now... I don't know how to create the function to say, if we already have 10 registrations for a specific day, we can't submit form anymore with text message "Not available"... I'v tried something like that without success... 

If(CountIf('Reservation parking AIX';DataCardValue13.SelectedDate='Reservation parking AIX')=6;false;EditForm(Form2))

 

I really hope that you can help 😉

 

Many thanks, 

Bastien

Categories:
I have the same question (0)
  • DylanSimons Profile Picture
    326 on at

    You're absolutely on the right track with that CountIf(). It looks like you aren't specifying the column to compare to the SelectedDate. The CountIf would look like this:

     

    CountIf('Reservation parking AIX'; 'DateColumnFromDataSource' = DataCardValue13.SelectedDate)

     

    And then you can use the Notify() function to have a banner telling the user "no more spaces available" Like this:

    If(CountIf('Reservation parking AIX'; 'DateColumnFromDataSource' = DataCardValue13.SelectedDate) = 10; Notify("No more spaces available on that date"))

     

     

  • Verified answer
    CU-18081211-6 Profile Picture
    9,270 Moderator on at

    Hi @Anonymous ,

     

    I think that your notification should appear before you select the button "Je Book". That's why it's better to move your logic / verification on OnChange property of the DatePicker control.

    The function CountIf unfortunatelly cannot be delegated to Sharepoint (that's why you received a yellow sign warning, it gives a sign of not very good coding 🙂), and for this reason I propose the following solution (where YourDateColumn is your real name of the date column):

    If(
    CountRows(
    Filter(
                GroupBy('Reservation parking IX';'YourDateColumn';'Result');
                 'YourDateColumn' = DataCardValue13.SelectedDate)
    )>9;
    Notify("No more spaces available on that date");;UpdateContext({disableButton:true});
    UpdateContext({disableButton:false})

    I hope that you saw that Iintroduced a context variable - boolean called disableButton, which is thought to control the displaymode property of button (it's necessary to avoid accidental submit form after notify text dissapeared). So DisplayMode of Button control should look like this:

    If (disableButton,DisplayMode.Disabled,DisplayMode.Edit)

    OnVisible Screen -> OnStart insert the following code to initialize the disableButton variable:

    UpdateContext({disableButton:false}

    And last, set OnSelect property of the Button to:

                 Submit(Form2)

    I notice that you use the european way for writting code, that's why i'm not 100% sure about syntax (; vs. ;; and " vs ' ).

     

    Hope it helps !

  • Community Power Platform Member Profile Picture
    on at
    Many thanks 😉
  • Community Power Platform Member Profile Picture
    on at
    Many thanks 🙂
  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    Hi @Anonymous ,

    If one of the answers satisfy your request, please don't forget to accepted it as a solution.

     

    Thank you !

  • cstack Profile Picture
    15 on at

    Hi all,

    It has been a year plus since this has been posted and answered.  I am looking for a parking solution as well.  We have 5 parking spots and due to hybrid work different people come in on different days.  How is the above solution working.  Any advice?

     

    Christine

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard