cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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

Hi @Anonymous ,

 

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 @Anonymous ,

 

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

Anonymous
Not applicable

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

It shows error.😅 

 

 

paint.png

 

 

Hi @Anonymous ,

 

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

Anonymous
Not applicable

@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
);

 

Hi @Anonymous ,

 

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

Anonymous
Not applicable

@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 );

 

Hi @Anonymous ,

 

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

Anonymous
Not applicable

 

@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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,420)