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 / Remove Specific elemen...
Power Apps
Unanswered

Remove Specific elements from Collection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have this Collection which assigned to drop down, 

 

` Collect(AddTaxiTimeSlots, ["05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21"]);` 

 

I need to remove two hours ahead of current time, for example if now time is 15:10 pm then function needs to remove 16,17 from the collection,

 

I have tried my best to do it, but didn't succeed , Any help would much appreciate. 

Categories:
  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @Anonymous ,

    With({currentHour:Hour(Now())},
    RemoveIf(

         AddTaxiTimeSlots,

         Value=Text(currentHour+1) ||

         Value=Text(currentHour + 2)

    )

    )

    Is there a specific reason to keep the hours as string not integers ?

    Hope it helps !

  • eka24 Profile Picture
    20,925 on at

    While agreeing with @gabibalaban , another approach would be:
    Insert a Timer and set the following properties

    Duration: 1000

    Repeat: true

    Start: true

    Autostart: true

    OnTimerEnd: ClearCollect(colHourNow,{NextHours:Text(Now(), "hh" )+1},{NextHours:Text(Now(), "hh" )+2});RemoveIf(AddTaxiTimeSlots,Value in colHourNow.NextHours)

     

    In your Dropdown : AddTaxiTimeSlots

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard