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

Is there a way to get the calendar items of more than one user using Office365Outlook.V2CalendarGetItems().value

I am using the Office365Outlook.V2CalendarGetItems().value function to get the times for calendar items for a bunch of users. I tried to get the calendar names from Office365Outlook.CalendarGetTables().value and then bring them together split up by a semicolon. 

So like "name1;name2;name3" and I put that into a variable called calendarNames and did this: Office365Outlook.V2CalendarGetItems(calendarNames ).value. But I got an error saying it was invalid so I'm wondering if I need something else to split them up or is it just not possible. 

I'm able to get it to work by putting the names in a collection and doing a ForAll on the collection and calling the Office365Outlook.V2CalendarGetItems().value for each name one at a time. My only issue with this is the performance. 

Just want to confirm if this function can do multiple users at the same time or do I have to stick with the ForAll? Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

Hi @Mgodby ,

 

According to your description, I think using forall() function is the correct way.

 

V2CalendarGetItems() can only add one calendar ID parameter at a time.

You could know it from the syntax below.

v-xiaochen-msft_0-1610442529783.png

 

So, Using loops can solve this problem.

 

In addition ,you could try to use Concurrent() function on a button control . 

 

Concurrent(
Collect(AAA,Office365Outlook.V2CalendarGetItems(Last(FirstN(Office365Outlook.CalendarGetTables().value,1)).Name).value),
Collect(BBB, Office365Outlook.V2CalendarGetItems(Last(FirstN(Office365Outlook.CalendarGetTables().value,2)).Name).value),
Collect(CCC,Office365Outlook.V2CalendarGetItems(Last(FirstN(Office365Outlook.CalendarGetTables().value,3)).Name).value)
,....,....);
ClearCollect(Test,AAA,BBB,CCC,...,...)

 

The Concurrent() function evaluates multiple formulas at the same time.

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

1 REPLY 1
Microsoft
Microsoft

Hi @Mgodby ,

 

According to your description, I think using forall() function is the correct way.

 

V2CalendarGetItems() can only add one calendar ID parameter at a time.

You could know it from the syntax below.

v-xiaochen-msft_0-1610442529783.png

 

So, Using loops can solve this problem.

 

In addition ,you could try to use Concurrent() function on a button control . 

 

Concurrent(
Collect(AAA,Office365Outlook.V2CalendarGetItems(Last(FirstN(Office365Outlook.CalendarGetTables().value,1)).Name).value),
Collect(BBB, Office365Outlook.V2CalendarGetItems(Last(FirstN(Office365Outlook.CalendarGetTables().value,2)).Name).value),
Collect(CCC,Office365Outlook.V2CalendarGetItems(Last(FirstN(Office365Outlook.CalendarGetTables().value,3)).Name).value)
,....,....);
ClearCollect(Test,AAA,BBB,CCC,...,...)

 

The Concurrent() function evaluates multiple formulas at the same time.

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (18,004)