Hi all,
I have two SharePoint list below.
Desk: show all desk icon on map (X,Y)
DeskReservations: Desks booked
How I create a formula to refresh desks status when I select a date or multiple dates and a time slot?
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"})
Solved! Go to Solution.
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
Booking Time always works with a Date. So Data with Time (DateTime) always make sense in your use case.
Thanks,
Stalin - Learn To Illuminate
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
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
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
Booking Time always works with a Date. So Data with Time (DateTime) always make sense in your use case.
Thanks,
Stalin - Learn To Illuminate
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
184 | |
53 | |
41 | |
36 | |
30 |
User | Count |
---|---|
240 | |
74 | |
71 | |
69 | |
65 |