Hello,
i was trying to use calendar screen template in power apps with a little bit custom there to show my room's event. I have try to add a timer to get currentdatetime and display it in a label, and then i want to create a condition if label which display 'start event' is equal to label which display currentdatetime then my label which display organizer and subject will be visible for around 10 minutes. i have tried but it shows all the event as the picture below
How to make the label which display organizer and subject will be visible only for the 'start event' is equal to currentdatetime?
Thank you
Hi @AdhamFH .
Do you want to make labels for organizer and subject be visible when 'start event' in that item is equal to currentdatetime for around 10 minutes?
Could you tell me:
1)whether do you want to filter the gallery for around 10 minutes to only display items that 'start event' is equal to currentdatetime
or change labels of organizer and subject's visibility for around 10 minutes?
2)how do you get currentdatetime? use what formula?
I assume that you get currentdatetime by using formula like this:
Set(currentdatetime,Now())
1)If you want to filter items for around 10 minutes, you could set like this:
timer's AutoStart:
!IsEmpty(Filter(MyCalendarEvents, Text(Start, DateTimeFormat.ShortDate) = Text(_dateSelected, DateTimeFormat.ShortDate),Start=currentdatetime))
timer's Duration:
600000
timer's OnTimerStart:
Set(var,true)
timer's OnTimerEnd:
Set(var,false)
set CalendarEventsGallery1's Items:
If(var,SortByColumns(Filter(MyCalendarEvents, Text(Start, DateTimeFormat.ShortDate) = Text(_dateSelected, DateTimeFormat.ShortDate),Start=currentdatetime), "Start"),
SortByColumns(Filter(MyCalendarEvents, Text(Start, DateTimeFormat.ShortDate) = Text(_dateSelected, DateTimeFormat.ShortDate)), "Start"))
//In this way, then there's item that start is equal to currentdatetime, the gallery will only display items that start is equal to currentdatetime for 10 minutes.
2)If you want to display organizer and subject that start is equal to currentdatetime for 10 minutes, you could set like this:
timer's AutoStart:
!IsEmpty(Filter(MyCalendarEvents, Text(Start, DateTimeFormat.ShortDate) = Text(_dateSelected, DateTimeFormat.ShortDate),Start=currentdatetime))
timer's Duration:
600000
timer's OnTimerStart:
Set(var,true)
timer's OnTimerEnd:
Set(var,false)
set label for organizer and subject's Visible:
If(var&&ThisItem.Start=currentdatetime,true,false)
//In this situation, when there's item that start is equal to currentdatetime, var will be set to true for 10 minutes.
In the gallery, when that item's star is equal to currentdatetime, the label for organizer and subject will be visible.
Best regards,