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

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

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,582)