web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Using Forall in ClearC...
Power Apps
Answered

Using Forall in ClearCollect creates a collection of tables. Need to have them all in a single table

(0) ShareShare
ReportReport
Posted on by 293

Hi! currently I'm having a problem with this.

I have a gallery with 2 items. each element has a "InicioMinutos" and "FinMinutos" value.
I have a collection of ALL the posible values of "InicioMinutos" and "FinMinutos".

those values are taken from a column "Minutes" in a collection called Times



I want to have a collection of all the Times inbetween InicioMinutos and FinMinutos of each element.

So the collection should contain all the values between InicioMinutos and FinMinutos of the first element and all the values between InicioMinutos and FinMinutos of the second element.

 

This is the code I'm using

 

ClearCollect(Ocupados; ForAll(CalendarEventsGallery1_4.AllItems; Filter(Times; Minutes >= Value(InicioMInutos.Text) && Minutes <= Value(FinMinutos.Text))))

 

 

And while this works fine, the problem is that it creates a collection of tables with 2 values, one for each element of the gallery.
each table with the same columns, the ones of the Times collection.

I want it to be ONLY 1 table with all the values, since I need to use values from all the elements in the gallery I HAVE to use the forall.

 
 
Categories:
I have the same question (0)
  • Verified answer
    FacundoGorla Profile Picture
    293 on at

    Solved it using a collect inside forall and not the way it was before.

    Since I need to clear the collection first also used clear. Now it looks like these:

    Clear(Ocupados2);; ForAll(CalendarEventsGallery1_4.AllItems; Collect(Ocupados2; Filter(Times; Minutes >= Value(InicioMInutos.Text) && Minutes <= Value(FinMinutos.Text))))

     

  • v-yutliu-msft Profile Picture
    on at

    Hi @FacundoGorla ,

    I'm very glad that you've solved your problem.

    Do you have any other problems?

    If not, could you change your issue's status to "Answered"?

    Thanks!

     

     

    Best regards,

  • FacundoGorla Profile Picture
    293 on at

    Oh sorry, I'll change it now.

    Since we are already here I have another problem, maybe you can help me.
    I need to insert the EventID of a calendar event into an item of a SP list.

    The app is basically a calendar management app and it creates the events as a calendar event and as an item of a list.
    Is there a way to inmediately take the eventid and put it in the SP list item that is creating almost at the same time?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard