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

Unknown Error from Office365Outlook.SetAutomaticRepliesSettingV2 directly in PowerFX

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!

1 ACCEPTED SOLUTION

Accepted Solutions
lucar2k
Frequent Visitor

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.

View solution in original post

4 REPLIES 4
lucar2k
Frequent Visitor

*bump*

lucar2k
Frequent Visitor

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
Advocate III
Advocate III

@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. 👍

 

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 😊

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.

Top Solution Authors
Top Kudoed Authors
Users online (2,232)