Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Error with Office365Outook.V4CalendarPostItem

(1) ShareShare
ReportReport
Posted on by 2
I have following Code: 
 
 
Set(
    startDate,
    DateValue(
        Text(DatePicker1_2.SelectedDate, "dd-mm-yyyy") & " " &
        Text(Value(Dropdown1_6.Selected.Value), "00") & ":" &
        Text(Value(Dropdown1_7.Selected.Value), "00")
    )
);
 
Set(
    endDate,
    DateValue(
        Text(DatePicker1_3.SelectedDate, "dd-mm-yy") & " " &
        Text(Value(Dropdown1_8.Selected.Value), "00") & ":" &
        Text(Value(Dropdown1_9.Selected.Value), "00")
    )
);
 
// Patch-Befehl für das Hinzufügen von Daten in die SharePoint-Liste
If(
    IsBlank(cb_PeoplePicker.Selected) || IsBlank(cb_PeoplePicker_1.Selected),
    Notify("Bitte wählen Sie einen Wert für Requester und Contact Person aus.", NotificationType.Error),
    Patch(
        'Besucheranmeldung PowerApps - testing',
        Defaults('Besucheranmeldung PowerApps - testing'),
        {
            Requester: {
                '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                Claims: "i:0#.f|membership|" & cb_PeoplePicker.Selected.Mail,
                Department: "",
                DisplayName: cb_PeoplePicker.Selected.DisplayName,
                Email: cb_PeoplePicker.Selected.Mail,
                JobTitle: "",
                Picture: ""
            },
            'Grammer Location visited': Dropdown1_3.Selected.Value,
            'Contact Person':{
                '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                Claims: "i:0#.f|membership|" & cb_PeoplePicker_1.Selected.Mail,
                Department: "",
                DisplayName: cb_PeoplePicker_1.Selected.DisplayName,
                Email: cb_PeoplePicker_1.Selected.Mail,
                JobTitle: "",
                Picture: ""
            },
         'Day of Arrival': DateTimeValue(Text(startDate, "[$-en-US]dd/mm/yyyy HH:mm")),
        'Day of Departure': DateTimeValue(Text(endDate, "[$-en-US]dd/mm/yyyy HH:mm")),
        Creator: varCurrentUser,
        'More then 1 Visitor': Dropdown1_13.Selected.Value,
        VisitorName1: TextInput1_6.Text,
        VisitorName2: TextInput1_9.Text,
        VisitorName3: TextInput1_10.Text,
        VisitorName4: TextInput1_13.Text,
        VisitorName5: TextInput1_16.Text,
        'More then 1 Company': Dropdown1_14.Selected.Value,
        CompanyName1: TextInput1_21.Text,
        CompanyName2: TextInput1_22.Text,
        CompanyName3: TextInput1_23.Text,
        CompanyName4: TextInput1_24.Text,
        CompanyName5: TextInput1_25.Text,
        VisitorEmail1: TextInput1_14.Text,
        VisitorEmail2: TextInput1_26.Text,
        VisitorEmail3: TextInput1_27.Text,
        VisitorEmail4: TextInput1_28.Text,
        VisitorEmail5: TextInput1_29.Text,
        'Reason of visit': TextInputCanvas1.Value,
       'Wifi Access needed': Checkbox2_8.Value,
        'Number of Accesses': Value(NumberInput1_8.Value),
        'Area which is visited': If(
            IsEmpty(ComboboxCanvas2_1.SelectedItems),
            Blank(),
            Concat(ComboboxCanvas2_1.SelectedItems, Value & ", ")
        ),
        'Exact area visited:': If(
            IsEmpty(ComboboxCanvas2.SelectedItems),
            Blank(),
            Concat(ComboboxCanvas2.SelectedItems, Value & ", ")
        )
    }
);
 
// Kalender-Event erstellen
Office365Outlook.V4CalendarPostItem(
    "Calendar", // Kalendername
    "Besucheranmeldung - " & ComboboxCanvas2.Selected.Value & " - " & ComboboxCanvas2_1.Selected.Value, // Betreff mit visitedArea und exactArea
    DateAdd(DateTimeValue(DatePicker1_2.SelectedDate & " " & Dropdown1_6.Selected.Value & ":" & Dropdown1_7.Selected.Value), TimeZoneOffset(), TimeUnit.Minutes), // Startdatum und -zeit
    DateAdd(DateTimeValue(DatePicker1_3.SelectedDate & " " & Dropdown1_8.Selected.Value & ":" & Dropdown1_9.Selected.Value), TimeZoneOffset(), TimeUnit.Minutes), // Enddatum und -zeit
    "(UTC) Coordinated Universal Time", // Zeitzone
    {
        requiredAttendees: "xy@gmail.com",
        location: "Immenstetten", // Festgelegter Standort
   body:"Grund des Besuchs: " & TextInputCanvas1.Value
    }
);
 
 
When I set my browser language to English, everything works fine and the calendar event is created. However, if I change the browser language to German, the creation of the calendar event no longer works. I get the following error message: String was not recognized as a valid DateTime status 400. The date is made up of the two date pickers for start and end date and four dropdowns for start time in hours and minutes. I also send emails with date and time in a separate place, it works in both languages, I think it must really depend on the event for the creation of the calendar event. I would be very grateful for help.
Translated with DeepL.com (free version)
Categories:
  • mstavra Profile Picture
    247 on at
    Error with Office365Outook.V4CalendarPostItem
    As @FLMike said i think your issue lies on the date format. I had similar issues with dots and commas on currency and this can be a pain. 
     
    I would suggest to play a bit with date formats to see if this resolve your issue. Maybe try a YYYY-MM-DD date format which in general is accepted by any language.
  • Suggested answer
    Michael E. Gernaey Profile Picture
    40,331 Super User 2025 Season 1 on at
    Error with Office365Outook.V4CalendarPostItem
    Hi
     
    My guess, as I cannot see it, is that when you change the Language, you are changing the Date Format, which will need to match that languages Date Format.
     
    That I believe is your issue,
     
    Or you have adding some German into the Date and not meaning to
     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard