Hi all,
Currently facing an issue with an update to an app I'm trying to make.
I have a desk booking app that we are currently updating to have a live map of the office and desks.
I've added 46 icons next to each desk that will only become visible if someone that is a first aider has selected to book that desk on todays date.
For example, for Desk 46 the criteria that the formula looks for is if the DeskText field contains Desk 46, the First Aider choice field = Yes and the BookingDate is todays date, if so it should make the icon visible:
Visible = If(LookUp(DeskBookings, DeskText = "Desk 46" && FirstAider.Value = "Yes" && BookingDate = Today(), true)
This does not work and I can't figure out if it's the LookUp statement not being completed correctly, the If statement or just the entire thing is wrong.
Any help and explanation is appreciated.
Thanks all!
Sorry folks - I don't mean to offend anyone.
Filter is terribly inefficient in this scenario.
You could potentially have to filter many records and then count them.
What if there are 300 records?
A lookup only needs to find one case where it's true, doesn't have to count any records and is far more efficient.
Thanks mmbr1606, if you don't mind can I ask:
What's the purpose of "CountRows" and also what is the purpose of the "> 0" near the end of the formula.
Put this in the visible property
!IsBlank(
LookUp(
DeskBookings,
And(
DeskText = "Desk 46",
FirstAider.Value = "Yes",
BookingDate = Today()
),
DeskText
)
hey @MHSPDev
can u please try this:
If(
CountRows(
Filter(
DeskBookings,
DeskText = "Desk 46" &&
FirstAider.Value = true &&
DateValue(Text(BookingDate, DateTimeFormat.ShortDate)) = Today()
)
) > 0,
true,
false
)
Let me know if my answer helped solving your issue.
If it did please accept as solution and give it a thumbs up so we can help others in the community.
Greetings
WarrenBelz
146,601
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,946
Most Valuable Professional