cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Leander
Frequent Visitor

Is there a way to get office365 calendar without an error when I check for two different Id's ?

I was personalizing the meeting capture sample.

 

I knew that I have to change the Variable "MyCalendarId" becaus of the language difference but we have some with the english Id "Calendar" and some wit the german "Kalendar".

Because of that I added another variable with the german Id.

 

This is a part of the OnStart code:

Concurrent(

    Set(MyCalendarID; LookUp(Office365.CalendarGetTables().value; DisplayName = "Calendar").Name);;
    Set(MyCalendarID2; LookUp(Office365.CalendarGetTables().value; DisplayName = "Kalender").Name);;

    ClearCollect(AllFutureEvents; Office365.GetEventsCalendarView(MyCalendarID2; Text(Today(); UTC); Text(DateAdd(Today(); 2; Days); UTC)).Values);;

    If(IsEmpty(AllFutureEvents); ClearCollect(AllFutureEvents; Office365.GetEventsCalendarView(MyCalendarID; Text(Today(); UTC); Text(DateAdd(Today(); 2;
Days); UTC)).Values));
Set(MyUserProfile; Office365Users.MyProfile().Id);     /*used to determine if meeting attendees are in app user's org*/ Set(MyDomain; Last(Split(User().Email; "@")).Result);
    /*used to determine countdown to end of selected meeting*/
Set(HomeTimerStart; Now()) );;

 

Now all User's wit the english Id are getting there entries, but also an error because the program checks first the german Id. So there is no matter if  I'm first checking the german or the english Id, the other group of users will get an error.

 

I also tried to use the IfError() funktion but it didn't work.

 

IfError(ClearCollect(AllFutureEvents; Office365.GetEventsCalendarView(MyCalendarID; Text(Today(); UTC); Text(DateAdd(Today(); 2; Days); UTC)).Values);

ClearCollect(AllFutureEvents; Office365.GetEventsCalendarView(MyCalendarID2; Text(Today(); UTC); Text(DateAdd(Today(); 2; Days); UTC)).Values));

 

So is there any way to get this without an error ?

2 REPLIES 2
Leander
Frequent Visitor

I'm sorry for posting this 3 times but there were some problems at publishing this post. I don't know how to delete a post so please if you want to reply go to my profile and do that at the first post with the same title.

jazama
New Member

I know this a very old post but I'll add this other link thread with a similar discussion.

 

https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-Find-the-Default-Calendar-of-the-user...

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.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (6,026)