cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mssss
Helper V
Helper V

Get Outlook Calendars schedule with specific condition

Hello Guys,

 

I'm trying to make a collection table (Collect) from 365 Outlook Calendars schedule with a specific conditions.

Here is my condition.

  • User Department: “Sales” only
  • Event title :“Manager Meeting”
  • “all day event” only

 

I would like to take a “start date” and “user name” form those schedules.

Can someone help me?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @mssss ,

 

ClearCollect(
    ColFilteredEvents, 
    Filter(
        ColEvents,
        IsAllDay,
        Organizer.EmailAddress.Address in 'SaleMembersCollection',
        Subject="Manager Meeting"
    )
)

This code will get all events that organizer's email is in the SaleMembersCollection.

However, there is no way to retrieve other users' calendar event list, Office 365 Outlook connector can only output all events from your own calendar(whatever you are organizer or attendee), 

Hope this helps.

Sik

View solution in original post

8 REPLIES 8
v-siky-msft
Community Support
Community Support

Hi @mssss ,

 

Please try with this code.

ClearCollect(ColEvents, Office365Outlook.CalendarGetItems(CalendarID,{'$top':999}).value);
ClearCollect(ColFilteredEvents, Filter(ColEvents,IsAllDay, Office365Users.UserProfileV2(Organizer.EmailAddress.Address).department="Sales", Subject="Manager Meeting")

 The ColFilteredEvents collection is what you want.

Hope this helps.

Sik

@v-siky-msft 
Thank you for your help.😄

It shows error.😅 

 

 

paint.png

 

 

v-siky-msft
Community Support
Community Support

Hi @mssss ,

 

OK, You need to add Office365 outlook connection to the app. And then Modify the code as follows.

ClearCollect(
    ColEvents,
    Office365Outlook.CalendarGetItems(
        LookUp(
            Office365Outlook.CalendarGetTablesV2().value,
            name = "Calendar"
        ).id,
        {'$top': 999}
    ).value
);
ClearCollect(
    ColFilteredEvents, 
    Filter(
        ColEvents,
        IsAllDay,
        Office365Users.UserProfileV2(Organizer.EmailAddress.Address).department="Sales",
        Subject="Manager Meeting"
    )
)

 Sik

@v-siky-msft 
Thank you for your help!

 

I've checked that I could get  "ColEvents" from your advice.

but was my calendar item...😅

Is it possible to "getitems" from all of my sales department's?

If that is not possible, I have a list of collection of sales members. Could that help to getitems😥?

 

ClearCollect(
    ColEvents,
    Office365Outlook.CalendarGetItems(
        LookUp(
            Office365Outlook.CalendarGetTablesV2().value,
            name = "Calendar"
        ).id,
        {'$top': 999}
    ).value
);

 

v-siky-msft
Community Support
Community Support

Hi @mssss ,

 

Yes, try to filter the calendar items that the Organizer Email is in the sales members collection.

ClearCollect(
    ColFilteredEvents, 
    Filter(
        ColEvents,
        IsAllDay,
        Organizer.EmailAddress.Address in 'SaleMembersCollection',
        Subject="Manager Meeting"
    )
)

 Hope this helps,

Sik

@v-siky-msft 

 

Thanks,

ColFilteredEvents ,is created only form my calendar.

but the calendar event I would like to get is not in mine.😅

 

How can I  get my sals member's calendar event??

I would like to do someting like this.

ClearCollect(
    ColEvents,
    Office365Outlook.CalendarGetItems(
        LookUp(
            Office365Outlook.CalendarGetTablesV2().value,
            department = "sales" or mailaddress = "**@***com"
).id, {'$top': 999} ).value );

 

v-siky-msft
Community Support
Community Support

Hi @mssss ,

 

ClearCollect(
    ColFilteredEvents, 
    Filter(
        ColEvents,
        IsAllDay,
        Organizer.EmailAddress.Address in 'SaleMembersCollection',
        Subject="Manager Meeting"
    )
)

This code will get all events that organizer's email is in the SaleMembersCollection.

However, there is no way to retrieve other users' calendar event list, Office 365 Outlook connector can only output all events from your own calendar(whatever you are organizer or attendee), 

Hope this helps.

Sik

 

@v-siky-msft 
Thank you so much😊

"there is no way to retrieve other users' calendar event list",  this was what I wanted to know.😁

 

I will use shared calendar 🙂

https://powerusers.microsoft.com/t5/Building-Power-Apps/Get-Calendar-from-Outlook-Group/m-p/568318#M...

 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (4,337)