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

Refresh desks status /colMap in Gallery

Hi all,

 

I have two SharePoint list below.

 

Desk: show all desk icon on map (X,Y)

kinghnvn_2-1638892892103.png

DeskReservations: Desks booked

kinghnvn_4-1638893049160.png

 

How I create a formula to refresh desks status when I select a date or multiple dates and a time slot?

 

kinghnvn_0-1638892647314.png

 

I'm trying to edit below code

 

Set(
LocationInfoLabel,
Blank()
);
ClearCollect(
colOfficeBookingForThisDate,
Filter(
DeskReservations,

FromDate = Calendar_2.StartDate,

ToDate = Calendar_2.EndDate,

StartTime = Text(ddTimeFrom_1.Selected.Value),

EndTime = Text(ddTimeTo_1.Selected.Value)
)
);UpdateContext({LabelName:"Book"})

 

@StalinPonnusamy 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @kinghnvn 

 

StartTime and End time are single-line text then we need to convert to Datetime value like

Filter(
DeskReservations,
FromDate >= Calendar_2.StartDate,
ToDate <= Calendar_2.EndDate,
DateTimeValue(StartTime) >= DateTimeValue(ddTimeFrom_1.Selected.Value),
DateTimeValue(EndTime) <= DateTimeValue(ddTimeTo_1.Selected.Value)
)

 

Sample

StalinPonnusamy_0-1639025223455.png

 

Booking Time always works with a Date. So Data with Time (DateTime) always make sense in your use case.

 


Thanks,
Stalin - Learn To Illuminate

View solution in original post

3 REPLIES 3
StalinPonnusamy
Super User
Super User

Hi @kinghnvn 

 

Looks like you have Start and End Time as Text in SharePoint. Any reason why you have text instead of DateTime. It's hard to convert and compare. Anyway

 

Filter(
DeskReservations,
FromDate >= Calendar_2.StartDate,
ToDate <= Calendar_2.EndDate,
StartTime >= DateTimeValue(ddTimeFrom_1.Selected.Value),
EndTime <= DateTimeValue(ddTimeTo_1.Selected.Value)
)

 

 


Thanks,
Stalin - Learn To Illuminate

@StalinPonnusamy 

 

Any reason why you have text instead of DateTime -> because I just want to update start time only.

If I use below code it doesn't work. Please advise. Thanks.

 

StartTime: ddTimeFrom_1.Selected.Value

 

kinghnvn_0-1639016744095.png

 

Hi @kinghnvn 

 

StartTime and End time are single-line text then we need to convert to Datetime value like

Filter(
DeskReservations,
FromDate >= Calendar_2.StartDate,
ToDate <= Calendar_2.EndDate,
DateTimeValue(StartTime) >= DateTimeValue(ddTimeFrom_1.Selected.Value),
DateTimeValue(EndTime) <= DateTimeValue(ddTimeTo_1.Selected.Value)
)

 

Sample

StalinPonnusamy_0-1639025223455.png

 

Booking Time always works with a Date. So Data with Time (DateTime) always make sense in your use case.

 


Thanks,
Stalin - Learn To Illuminate

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (2,081)