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

 

lucar2k
Frequent Visitor

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,072)