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 / Collection isn't pulli...
Power Apps
Unanswered

Collection isn't pulling information from other collection by using ClearCollect()

(0) ShareShare
ReportReport
Posted on by

 

Hello all!

 

I have a form that has 2 buttons at the bottom of the screen. The red one is called "button11". The blue one is called "saveButton":

jharville_1-1628655097093.png

^^ (I have both of these buttons for testing purposes, but will eventually build both of their functionalities into one button)

 

When "Button11" is clicked, I put the following code in the OnSelect property to create a collection called 'Info' that is populated with the following code:

 

 

Collect(
 Info,
 Filter(
 AddColumns(
 colConferenceroom,
 "AttributesNew",
 Concat(
 Attributes,
 Value,
 ","
 )
 ),
 Text(
 First(
 Split(
 varSelectedAttributes.Value,
 ","
 )
 ).Result
 ) in AttributesNew Or Text(
 Last(
 FirstN(
 Split(
 varSelectedAttributes.Value,
 ","
 ),
 2
 )
 ).Result
 ) in AttributesNew Or Text(
 Last(
 FirstN(
 Split(
 varSelectedAttributes.Value,
 ","
 ),
 3
 )
 ).Result
 ) in AttributesNew Or Text(
 Last(
 FirstN(
 Split(
 varSelectedAttributes.Value,
 ","
 ),
 4
 )
 ).Result
 ) in AttributesNew Or Text(
 Last(
 FirstN(
 Split(
 varSelectedAttributes.Value,
 ","
 ),
 5
 )
 ).Result
 ) in AttributesNew Or Text(
 Last(
 FirstN(
 Split(
 varSelectedAttributes.Value,
 ","
 ),
 6
 )
 ).Result
 ) in AttributesNew
 )
)

 

 

jharville_2-1628655555943.png

^^ There are no errors and the 'Info' collection seems to be populated perfectly.

 

So once "button11" is clicked, the 'Info' collection is populated. However, after "button11" has been clicked, I'd like to click the "saveButton" because it pulls elements from the 'Info' collection to create a new collection called 'AvailableRoomEmailName2' ... but 'AvailableRoomEmailName2' seems to be empty after I click "saveButton" (even though there are no errors in my code). Here's the code from my OnSelect property of "saveButton":

 

 

ClearCollect(
 AvailableRoomEmailName2,
 Select(Button11),
 AddColumns(
 RenameColumns(
 AvailableRoomEmails,
 "Result",
 "Email"
 ),
 "Name",
 LookUp(
 AllRooms,
 Email = Address
 ).Name
 )
);
Navigate(
 RoomSelectScreen,
 ScreenTransition.Cover
)

 

 

Would anybody know why 'AvailableRoomEmailName2' isn't being populated when my "saveButton" is clicked after "button11" is clicked?

 

Thank you!

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @jharville :

    Maybe you could try:

    Select(Button11);
    ClearCollect(
     AvailableRoomEmailName2,
     AddColumns(
     RenameColumns(
     AvailableRoomEmails,
     "Result",
     "Email"
     ),
     "Name",
     LookUp(
     AllRooms,
     Email = Address
     ).Name
     )
    );
    Navigate(
     RoomSelectScreen,
     ScreenTransition.Cover
    )

    Best Regards,

    Bof

  • jharville Profile Picture
    on at

    Hello, I appreciate the response. Unfortunately, despite not throwing any errors, the code didn't populate my collection:

     

    jharville_0-1628660889631.png

     

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @jharville :

    Could you tell me what "AvailableRoomEmails" is?Can you give me its definition formula or show its data?

    vbofengmsft_0-1628661675740.png

    Best Regards,

    Bof

     

     

  • jharville Profile Picture
    on at

    @v-bofeng-msft 

     

    Here is my code for the 'OnVisible' of my "RoomSelectScreen" that has the code for 'AvailableRoomEmails":

    Set(
     AllRoomsConnector,
     Concat(
     FirstN(
     AllRooms,
     20
     ),
     Address & ";"
     )
     );
     Concurrent(
     ClearCollect(
     AvailableRooms,
     Office365Outlook.FindMeetingTimes(
     {
     RequiredAttendees: AllRoomsConnector,
     IsOrganizerOptional: true,
     Start: StartDateTimeUTC,
     End: EndDateTimeUTC,
     MeetingDuration: DateDiff(
     StartDateTime,
     EndDateTime,
     Minutes
     ),
     MinimumAttendeePercentage: "1",
     ActivityDomain: "Unrestricted"
     }
     )
     ),
     If(
     CountRows(AllRooms) > 20,
     If(
     CountRows(AllRooms) > 40,
     Set(
     AllRoomsConnector1,
     Concat(
     LastN(
     FirstN(
     AllRooms,
     40
     ),
     20
     ),
     Address & ";"
     )
     ),
     Set(
     AllRoomsConnector1,
     Concat(
     LastN(
     AllRooms,
     CountRows(AllRooms) - 20
     ),
     Address & ";"
     )
     )
     );
     ClearCollect(
     AvailableRooms1,
     Office365Outlook.FindMeetingTimes(
     {
     RequiredAttendees: AllRoomsConnector1,
     IsOrganizerOptional: true,
     Start: StartDateTimeUTC,
     End: EndDateTimeUTC,
     MeetingDuration: DateDiff(
     StartDateTime,
     EndDateTime,
     Minutes
     ),
     MinimumAttendeePercentage: "1",
     ActivityDomain: "Unrestricted"
     }
     )
     ),
     Clear(AvailableRooms1)
     )
     );
     If(
     CountRows(AllRooms) > 20,
     Collect(
     AvailableRooms,
     AvailableRooms1
     )
     );
     ClearCollect(
     AvailableRoomsSorted,
     SortByColumns(
     First(AvailableRooms).MeetingTimeSuggestions,
     "Confidence",
     Descending
     ),
     If(
     CountRows(AllRooms) > 20,
     SortByColumns(
     Last(AvailableRooms).MeetingTimeSuggestions,
     "Confidence",
     Descending
     )
     )
     );
     ClearCollect(
     AvailableRoomsConcat,
     Concat(
     Filter(
     First(AvailableRoomsSorted).AttendeeAvailability,
     Availability = "Free"
     ),
     Attendee.EmailAddress.Address,
     ","
     ),
     If(
     CountRows(AllRooms) > 20,
     Concat(
     Filter(
     Last(AvailableRoomsSorted).AttendeeAvailability,
     Availability = "Free"
     ),
     Attendee.EmailAddress.Address,
     ","
     )
     )
     );
     ClearCollect(
     AvailableRoomEmails,
     Split(
     First(AvailableRoomsConcat).Value,
     ","
     ),
     If(
     CountRows(AllRooms) > 20,
     Split(
     Last(AvailableRoomsConcat).Value,
     ","
     )
     )
     );
     ClearCollect(
     AvailableRoomEmailName,
     AddColumns(
     RenameColumns(
     AvailableRoomEmails,
     "Result",
     "Email"
     ),
     "Name",
     LookUp(
     AllRooms,
     Email = Address
     ).Name
     )
     );

     

    And here is the view of the collection:

     

    jharville_0-1629309100639.jpeg

     

    Thank you!

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard