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 / Unknown Error from Off...
Power Apps
Answered

Unknown Error from Office365Outlook.SetAutomaticRepliesSettingV2 directly in PowerFX

(0) ShareShare
ReportReport
Posted on by 20

Hey!

 

I am currently trying to set an Out of Office Message directly in PowerFX since unfortunately my flows do not use the users personal account so therefore I have to do it this way.

 

This is my function, dateFrom and dateTo are both from Date Pickers in European Format but I dont think this is causing the Issue.

 

Office365Outlook.SetAutomaticRepliesSettingV2(
 {
 automaticRepliesSetting: {
 status: "Scheduled";
 internalReplyMessage: "Test";
 externalAudience: "All";
 externalReplyMessage: "Test";
 scheduledStartDateTime: {
 dateTime: dateFrom.SelectedDate;
 timeZone: DateTimeZone.Local
 };
 scheduledEndDateTime: {
 dateTime: dateTo.SelectedDate;
 timeZone: DateTimeZone.Local
 }
 }
 }
));;

 

running it results in this error:

 

 "body": {
 "error": {
 "code": "UnknownError",
 "message": "",
 "innerError": {
 "date": "2022-01-14T09:34:43",
 "request-id": "5ccb08ef-356f-469a-a446-ff17c4e38671",
 "client-request-id": "5ccb08ef-356f-469a-a446-ff17c4e38671"
 }
 }
 }

 

Thanks for the help already!

Categories:
  • lucar2k Profile Picture
    20 on at

    *bump*

  • Verified answer
    lucar2k Profile Picture
    20 on at

    for those wondering 

    timeZone: DateTimeZone.Local

    is not Supported needs to be DateTimeZone.UTC 

    Unknown Error is most likely caused because my Outlook Account has to have some Permission limitations.

  • dee2005 Profile Picture
    95 on at

    @lucar2k  it worked for me when I define the local timezone :

     

     

    Office365Outlook.SetAutomaticRepliesSettingV2(
     {
     automaticRepliesSetting:
     {
     status: "Scheduled",
     scheduledStartDateTime: { dateTime : _startTimeLocal, timeZone : "(UTC+04:00) Port Louis" },
     scheduledEndDateTime: { dateTime : _endTimeLocal, timeZone : "(UTC+04:00) Port Louis" },
     internalReplyMessage: InternalMessage.HtmlText,
     externalAudience: "All",
     externalReplyMessage: ExternalMessage.HtmlText
     }
     
     }

     

    I would never have gotten there however without your help, thanks a lot for the parameters for this action. 👍

     

  • lucar2k Profile Picture
    20 on at

    Hey!

    Good to know thanks for updating on that - the TimerZone stuff was a bit weird yeah.

     

    Glad that the post helped!

    Good Luck with your Project 😊

  • KI-13090739-0 Profile Picture
    12 on at

    Hi there,

    I am also struggling with time settings. Wanted to place it for Germany. With the syntax from you I got an error message like this.

    BHS_KI_0-1714564577682.png

    DateTime.UTC works but is not my target, DateTime.Local does not work although it should. 

  • lucar2k Profile Picture
    20 on at

     

    Office365Outlook.SetAutomaticRepliesSettingV2(
     {
     automaticRepliesSetting: {
     status: "Scheduled";
     internalReplyMessage: "text";
     externalAudience: "All";
     externalReplyMessage: "text";
     scheduledStartDateTime: {
     dateTime: Text(
     dateFrom.SelectedDate;
     "dd-mm-yyyy-HH"
     );
     timeZone: DateTimeZone.UTC
     };
     scheduledEndDateTime: {
     dateTime: Text(
     DateAdd(
     dateTo.SelectedDate; "24"; "Hours"
     ); 
     "dd-mm-yyyy-HH"
     );
     timeZone: DateTimeZone.UTC
     }
     }
     }
     );;

     


    Thats how I did it (German Time aswell)

    Nevermind sorry, since im only using days it does not really matter in my case. But you could calc the Dates to Match UTC+2 or would that cause Issues im not seeing?

     

     

     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard