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 / 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
    on at

    Deleted

  • Verified answer
    Community Power Platform Member Profile Picture
    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

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 765 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 272

Last 30 days Overall leaderboard