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 / add minutes datacard
Power Apps
Unanswered

add minutes datacard

(0) ShareShare
ReportReport
Posted on by 20

Hi, I need help with a desk booking app. I have a choice column in a SharePoint list.

 

The name of the choice column is 'Desks' is values are:

'Desk 1', 'Desk 2', 'Desk 3', 'Desk 4', 'Desk 5', 'Desk 6', 'Desk 7', 'Desk 8', 'Desk 9', 'Desk 10', 'Desk 11'.

 

I read the Desks into a datacard dropdown.

 

I have another choice column in the same SharePoint list, it is called Start_Time, it's values are as follows:

 

'05:00', '06:00', '07:00', '08:00', '09:00', '10:00'.

 

I have another choice column in the same SharePoint list, it is called End_Time, it's values are as follows:

 

'05:00', '06:00', '07:00', '08:00', '09:00', '10:00'.

 

So I read the times into a datacard dropdowns for the Start_Time and End_Time.

 

So I first check which desk is booked before I allow the booking so at to prevent duplicate bookings.

So if 'Desk 1' is booked from '05:00' to '09:00', it will not appear in the datacard that is showing the Desks if the user selects the Start_Time '05:00' and End_Time '09:00'.

 

But if the user selects Start_Time '09:00' to End_Time '10:00', then 'Desk 1' should appear. So for me to test the SharePoint list. I want to add one minute to the Start_Time '09:00' (must become '09:01') and End_Time '10:00' (must become '10:01').

This is for when I check for duplicates.

 

Can you please tell me how can I add a minute to the choice value in the datacard value.

 

Or is there a better way of doing this?

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,277 Most Valuable Professional on at

    Hi @StanSaggi ,

    You have not posted your code, but I suspect you are using >= and <= - just use > and <

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • StanSaggi Profile Picture
    20 on at

    This is my current code:

     

     

    Filter(
       Choices(DeskBookings.Desks),
       LookUp(
          DeskBookings,
          (
            (ReservationDate = DataCardValue2.SelectedDate && Value = Desks.Value && (TimeValue(Start_Time.Value) <= TimeValue(DataCardValue3.Selected.Value))
          && (TimeValue(End_Time.Value) >= TimeValue(DataCardValue3.Selected.Value)))

          || (ReservationDate = DataCardValue2.SelectedDate && Value = Desks.Value && (TimeValue(Start_Time.Value) >= TimeValue(DataCardValue4.Selected.Value))
          && (TimeValue(End_Time.Value) <= TimeValue(DataCardValue4.Selected.Value)))

          //|| (ReservationDate = DataCardValue2.SelectedDate && Value = Desks.Value && (TimeValue(Start_Time.Value) >= (TimeValue(Text(DataCardValue4.Selected.Value), "")))
          //&& (TimeValue(End_Time.Value) <= TimeValue(DateAdd(DataCardValue4.Selected.Value)))

          //|| (ReservationDate = DataCardValue2.SelectedDate && Value = Desks.Value && (TimeValue(Start_Time.Value) >= TimeValue(DataCardValue4.Selected.Value))
          //&& (TimeValue(End_Time.Value) <= TimeValue(DataCardValue4.Selected.Value)))
          ),
          ID
       ) = Blank()
    )
     
    I want to add the 1 minute in the last two comparing statements.
     
    This the SQL code I use to check for duplicates and it is working:
     

    AND (convert(datetime, convert(char(12), @ReservationDate, 111) + ' ' + @TimeFrom) between
    convert(datetime, convert(char(12), ReservationDate, 111) + ' ' + TimeFrom) and convert(datetime, convert(char(12), ReservationDate, 111) + ' ' + TimeTo)

    OR convert(datetime, convert(char(12), @ReservationDate, 111) + ' ' + @TimeTo) between
    convert(datetime, convert(char(12), ReservationDate, 111) + ' ' + TimeFrom) and convert(datetime, convert(char(12), ReservationDate, 111) + ' ' + TimeTo)

    OR
    convert(datetime, convert(char(12), ReservationDate, 111) + ' ' + TimeFrom) between
    convert(datetime, convert(char(12), @ReservationDate, 111) + ' ' + @TimeFroM) and DATEADD(mi,-1,convert(datetime, convert(char(12), @ReservationDate, 111) + ' ' + @TimeTo))

    OR
    convert(datetime, convert(char(12), ReservationDate, 111) + ' ' + TimeTo) between
    convert(datetime, convert(char(12), @ReservationDate, 111) + ' ' + @TimeFrom) and DATEADD(mi,-1,convert(datetime, convert(char(12), @ReservationDate, 111) + ' ' + @TimeTo))
    )

  • StanSaggi Profile Picture
    20 on at

    Hi @WarrenBelz , I see is not working correctly cause it does not consider the time that is equal to it. It only validates times that are bigger. 

     

    E.g. if there is a booking for Desk 1 from '05:00' to '09:00', then it will only validate from '06:00' and not '05:00'.

    Then if I select Start_Time '05:00', then it shows Desk 1 as available. Which is not correct. Cause the desk is booked from 05:00.

  • WarrenBelz Profile Picture
    156,277 Most Valuable Professional on at

    @StanSaggi ,

    You need to use one or the other - if you want to include the time, use <= or >=. If you want to exclude the actual time, use = 

  • StanSaggi Profile Picture
    20 on at

    Hi @WarrenBelz , I see is not working correctly cause it does not consider the time that is equal to it. It only validates times that are bigger. 

     

    E.g. if there is a booking for Desk 1 from '05:00' to '09:00', then it will only validate from '06:00' and not '05:00'.

    Then if I select Start_Time '05:00', then it shows Desk 1 as available. Which is not correct. Cause the desk is booked from 05:00.

  • WarrenBelz Profile Picture
    156,277 Most Valuable Professional on at

    Hi @StanSaggi ,

    I am confused - 5:01 has the same validation as > 5:00. I am not however an SQL user, so cannot help you with the code you have at the bottom.

  • StanSaggi Profile Picture
    20 on at

    Hi @WarrenBelz, could you please check my powerapps code below:

     

    Filter(
       Choices(DeskBookings.Desks),
       LookUp(
          DeskBookings,
          (
            (ReservationDate = DataCardValue2.SelectedDate && Value = Desks.Value && (TimeValue(Start_Time.Value) < TimeValue(DataCardValue3.Selected.Value))
          && (TimeValue(End_Time.Value) > TimeValue(DataCardValue3.Selected.Value)))

     

          || (ReservationDate = DataCardValue2.SelectedDate && Value = Desks.Value && (TimeValue(Start_Time.Value) > TimeValue(DataCardValue4.Selected.Value))
          && (TimeValue(End_Time.Value) < TimeValue(DataCardValue4.Selected.Value)))),
          ID
       ) = Blank()
    )
  • WarrenBelz Profile Picture
    156,277 Most Valuable Professional on at

    Hi @StanSaggi ,

    Without actually seeing your model, it looks correct.

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard