web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Returning error if no ...
Power Apps
Unanswered

Returning error if no meeting room is available

(0) ShareShare
ReportReport
Posted on by 36

Hi,

 

I'm trying to understand why the Book-a-Room app from Microsoft is failing all the time when there's no room available inside a group. Here does the error happen:

 

ClearCollect(AvailableRooms; Office365.FindMeetingTimes({RequiredAttendees: AllRoomsConnector; IsOrganizerOptional: true; 
 Start: StartDateTimeUTC; End: EndDateTimeUTC; MeetingDuration: DateDiff(StartDateTime; EndDateTime; Minutes);
 MinimumAttendeePercentage: "1"; ActivityDomain: "Unrestricted"}));

 

 

The error is:

 

Office365.FindMeetingTimes failed: {
 "error": {
 "code": "BadArgument",
 "message": "Attendees must be added if the organizer is optional",
 "details": [
 {
 "code": "UnsupportedScenario",
 "target": "IsOrganizerOptional",
 "message": "Attendees must be added if the organizer is optional"
 }
 ]
 }
}

 

 

Anyone with any clue how I can deal with this error? I tried to use the new IfError function:

 

IfError(
 ClearCollect(AvailableRooms; Office365.FindMeetingTimes({RequiredAttendees: AllRoomsConnector; IsOrganizerOptional: true; 
 Start: StartDateTimeUTC; End: EndDateTimeUTC; MeetingDuration: DateDiff(StartDateTime; EndDateTime; Minutes);
 MinimumAttendeePercentage: "1"; ActivityDomain: "Unrestricted"})), Notify("No rooms available.", Error));

 

 

But keep getting 'The formula contains 'ParenClose' where 'Error' is expected'

 

So any help is highly appreciated!

Categories:
I have the same question (0)
  • MirTechDev Profile Picture
    36 on at

    Anyone please help on this?

  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @MirTechDev ,

    Why don't you avoid the empty room list situation:

     

     

    If(
     IsEmpty(AllRoomsConnector);
     Notify("There is no room inside the selected group !");
     ClearCollect(AvailableRooms; 
     Office365.FindMeetingTimes({RequiredAttendees: AllRoomsConnector;
     IsOrganizerOptional: true; 
     Start: StartDateTimeUTC; 
     End: EndDateTimeUTC; 
     MeetingDuration: DateDiff(StartDateTime; 
     EndDateTime; 
     Minutes);
     MinimumAttendeePercentage: "1"; 
     ActivityDomain: "Unrestricted"})
     )
    );;

     

     

    Hope it helps !

  • MirTechDev Profile Picture
    36 on at

    Hi @gabibalaban 

    Thank you for the answer.

    There's something wrong in the code snippet you provide me, can you help me find this?

     

    Keep getting 'function if has some invalid arguments'

    power_apps_error.png
  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @MirTechDev ,

    Yes, there was a double quote missing in Notify() function.

    Also, I think that you ;; at the end of my code. 

    I corrected my previous post. 

  • MirTechDev Profile Picture
    36 on at

    Still keep getting another error:

    Invalid number of arguments: recieved 1, expected 2 or more.
     
    Here is the whole concurrent-function:

     

     Concurrent(
     If(
     IsEmpty(AllRoomsConnector);
     Notify("There is no room inside the selected group !");
     ClearCollect(AvailableRooms; 
     Office365.FindMeetingTimes({RequiredAttendees: AllRoomsConnector;
     IsOrganizerOptional: true; 
     Start: StartDateTimeUTC; 
     End: EndDateTimeUTC; 
     MeetingDuration: DateDiff(StartDateTime; 
     EndDateTime; 
     Minutes);
     MinimumAttendeePercentage: "1"; 
     ActivityDomain: "Unrestricted"})
     )
    );;
    
     If(
     CountRows(AllRooms) > 20;
     If(
     CountRows(AllRooms) > 40;
     Set(
     AllRoomsConnector1;
     Concat(
     LastN(
     FirstN(
     AllRooms;
     40
     );
     20
     );
     Address & ";"
     )
     );
     Set(
     AllRoomsConnector1;
     Concat(
     LastN(
     AllRooms;
     CountRows(AllRooms) - 20
     );
     Address & ";"
     )
     )
     );;
     ClearCollect(
     AvailableRooms1;
     Office365.FindMeetingTimes(
     {
     RequiredAttendees: AllRoomsConnector1;
     IsOrganizerOptional: true;
     Start: StartDateTimeUTC;
     End: EndDateTimeUTC;
     MeetingDuration: DateDiff(
     StartDateTime;
     EndDateTime;
     Minutes
     );
     MinimumAttendeePercentage: "1";
     ActivityDomain: "Unrestricted"
     }
     )
     );
     Clear(AvailableRooms1)
     )
     );;​

     

  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @MirTechDev ,

    We are inside of a Concurrent() function, please replace ;; with ; at the end of my formula.

  • MirTechDev Profile Picture
    36 on at

    Keep getting another error 😞
    Invalid argument type (Table). Expecting a Boolean value instead.

  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    In which part of the formula ? Please give a screen shot or smth relevant. 

  • MirTechDev Profile Picture
    36 on at

    @gabibalaban 

    Attached you find the part where it occurs.

    Annotation 2021-11-24 112710.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard