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

Get attendees from calendar events

This one is hurting my brain, kinda like watching 'Inception' with no sound and ASCII subtitles.

 

Using Office365 Outlook;

 

Collect(collectCalendarGetItems, Office365.CalendarGetItems("Calendar").value)

correctly stores calendar event in a collection for me.

 

If you navigate through the collection using the collection viewer;

  • Attendees is a column in the collection containing tables.
  • If you navigate into an Attendees table, it contain three columns EmailAddress, Status and Type columns.
  • The values of the Email Address data is also a table.
  • If you navigate into the Email Address table, it contains Address and Name columns.
  • Address contains the value I'm looking for.

 

There is a 1-to-many relationship between events and attendees which means if you want to carry any info from the top level down to any of the sub levels, you will have to do it for each entry in a sub level. 

I have to carry the event ID all the way down with me, so I can check which event the email address belongs to at the end.

 

Each Attendee email address that I'm looking for is 2 levels down.

 

At the end of all this, I just want to be able to reference a collection that contains all attendees [Address]es and the [Id] of the calendar event for which that attendee exists.

 

I've tried a ForAll to collect the Attendees.EmailAddress values of each event into another collection and then another ForAll to collect the EmailAddress.Address values - but it's only pulling the first one...perhaps I'm not going far enough down the iterations, but the syntax is killing me.  How do I end up with a collection of all the attendee addresses for all my events and a UID linking them back to their relevant events?

 

 This is as far as I got before my brain started curling up into a little ball;

 

ForAll(collectCalendarGetItems, Collect(CollectValues, {Id_level2: Id, Subject_level2: Subject, Attendees_level2: LookUp(Attendees.EmailAddress, true, EmailAddress.Address)}))

 

I'm just carrying the subject to help me see the data - all it does is return one (presumably the first) attendee email per event, and I'm guessing this is because the ID and Subject items are in a 1:* relationship with Attendees or because of how I'm running the LookUp with Id1=Id1...

 

Either way, like I said, Inception with no sound ASCII subtitles....

 

Kind regards,

 

R

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Get attendees from calendar events

Ironically enough, a decent night's sleep presented the solution.

Obviously the LookUp only returns one value - so I needed to iterate the LookUp through all Attendees by nesting another ForAll statement on Attendees - something I didn't know I could do.  It makes sense though as Attendees is a table so - it worked.

As an aside, I reduced the calendar entries to a 5-day spread to help make it quicker.

 

Clear(CollectValues);
ClearCollect(TodaysCalendar, Filter(CollectCalendarItems,DateDiff(DateValue(Start), Today(),Days) >-1 && DateDiff(DateValue(Start), Today(),Days) <5));
ForAll(TodaysCalendar, Collect(CollectValues, ForAll(Attendees, {Id_level1: Id, Subject_level1: Subject, Attendees_level1: EmailAddress.Address})))

Hope this helps someone!

 

R

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Re: Get attendees from calendar events

Ironically enough, a decent night's sleep presented the solution.

Obviously the LookUp only returns one value - so I needed to iterate the LookUp through all Attendees by nesting another ForAll statement on Attendees - something I didn't know I could do.  It makes sense though as Attendees is a table so - it worked.

As an aside, I reduced the calendar entries to a 5-day spread to help make it quicker.

 

Clear(CollectValues);
ClearCollect(TodaysCalendar, Filter(CollectCalendarItems,DateDiff(DateValue(Start), Today(),Days) >-1 && DateDiff(DateValue(Start), Today(),Days) <5));
ForAll(TodaysCalendar, Collect(CollectValues, ForAll(Attendees, {Id_level1: Id, Subject_level1: Subject, Attendees_level1: EmailAddress.Address})))

Hope this helps someone!

 

R

View solution in original post

Community Support Team
Community Support Team

Re: Get attendees from calendar events

Hi @Anonymous,

 

Thanks for the Update and sharing!

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MajaOlesen
Level: Powered On

Re: Get attendees from calendar events

Thank you for the post.
Did you encounter that the response status was None or missing for items that had responses, when looking in outlook?
If so did you solve it and how?

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 487 members 5,314 guests
Please welcome our newest community members: