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 / ForAll for creating a ...
Power Apps
Answered

ForAll for creating a collection

(0) ShareShare
ReportReport
Posted on by 21

I would like to create a collection that contains the resource rooms in our tennant.

First data source: "Rooms"
ClearCollect(Rooms,Office365Outlook.GetRoomsV2().value)

This gives you a name of the calendar and address field.

 

Second data source: "CalendarIDs"

ClearCollect(CalendarIDs, Office365Outlook.CalendarGetTablesV2().value)

This gives you ID and tha name of the calendar.

 

In the end I Create collection called "CalendarsDataSource"

 

 

 

ClearCollect(
 CalendarsDataSource,
 {
 Id: LookUp(
 Office365Outlook.CalendarGetTablesV2().value,
 "Luna" = name,
 id
 ),
 Name: LookUp(
 Office365Outlook.CalendarGetTablesV2().value,
 "Luna" = name,
 name
 ),
 Address: LookUp(
 Office365Outlook.GetRoomsV2().value,
 "Luna" = name,
 address
 )
 }
)

 

 

 

 

This will merge the two data source and gives a table with the address, calendar's ID and name

 

There are tons of rooms in our tenant so I would like to insert this in a ForAll() function

 

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Deleted

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    After a little more inspection, I came up with this, which looks like it's working. I started by making the variables easier by renaming the column names in the rooms and calendarIDs collections:

    ClearCollect(Rooms,Office365Outlook.GetRoomsV2().value);
    ClearCollect(CalendarIDs, Office365Outlook.CalendarGetTablesV2().value);
    Clear(MyRoomsList);Clear(MyCalendarIDs);
    ForAll(Rooms,Collect(MyRoomsList,{RoomName: name, RoomAddress: address}));
    ForAll(CalendarIDs,Collect(MyCalendarIDs,{CalendarName: name, CalendarID: id}));

     Then I did this formula to join them:

    ForAll(MyRoomsList,
    Collect(
     CalData,
     {
     RmName:RoomName,
     RmAddress:RoomAddress,
     CalID: LookUp(MyCalendarIDs,CalendarName=RoomName,CalendarID)
     }
    ))

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard