Hi All,
I'm trying to patch existing calendar entries, but I get the error below. Creating and deleting entries work just fine.
Was wondering if anyone could help point me in the right direction. Code listed below. It was originally found here: Power Apps Guide - Outlook - How to add, edit, delete, and list Outlook calendar events - Power Apps...
With({idCalendarEntry:
First(
Office365Outlook.GetEventsCalendarViewV3(calendarID ,
Concatenate(DatePicker1_1.SelectedDate, " ", If(Toggle1.Value=true,"00:00:00",TextInput7_1.Text)),
Concatenate(DatePicker1_2.SelectedDate, " ", If(Toggle1.Value=true,"23:59:59",TextInput7_2.Text)),
{search:Concatenate("Event: ",adsComboboxEvents_2.Selected.structureName)}
).value
)
},
Office365Outlook.V3CalendarPatchItem(
calendarID.
idCalendarEntry.id,
"New Subject Text",
Concatenate(DatePicker1_1.SelectedDate, " ", If(Toggle1.Value=true,"00:00:00",TextInput7_1.Text)),
Concatenate(DatePicker1_2.SelectedDate, " ", If(Toggle1.Value=true,"23:59:59",TextInput7_2.Text)),
{Body:"Updated calendar entry body text"}
)
)
Thanks in advance.
Hi @a-mccormack,
Based on the above, I think there is something syntax wrong with your calendarID, could you please tell me that how you define your calendarID?
To find out the calendarID, I think we could use the following formula to get it:
Set(calendarID,
LookUp(Office365Outlook.CalendarGetTablesV2().value,
name="Calendar").id
)
So, on your side, please modify your formula as below:
With({idCalendarEntry:
First(
Office365Outlook.GetEventsCalendarViewV3(calendarID ,
Concatenate(DatePicker1_1.SelectedDate, " ", If(Toggle1.Value=true,"00:00:00",TextInput7_1.Text)),
Concatenate(DatePicker1_2.SelectedDate, " ", If(Toggle1.Value=true,"23:59:59",TextInput7_2.Text)),
{search:Concatenate("Event: ",adsComboboxEvents_2.Selected.structureName)}
).value
)
},
Office365Outlook.V3CalendarPatchItem(
LookUp(Office365Outlook.CalendarGetTablesV2().value, name="Calendar").id,
idCalendarEntry.id,
"New Subject Text",
Concatenate(DatePicker1_1.SelectedDate, " ", If(Toggle1.Value=true,"00:00:00",TextInput7_1.Text)),
Concatenate(DatePicker1_2.SelectedDate, " ", If(Toggle1.Value=true,"23:59:59",TextInput7_2.Text)),
{Body:"Updated calendar entry body text"}
)
)
Or you could reference to the variable as below:
With({idCalendarEntry:
First(
Office365Outlook.GetEventsCalendarViewV3(calendarID ,
Concatenate(DatePicker1_1.SelectedDate, " ", If(Toggle1.Value=true,"00:00:00",TextInput7_1.Text)),
Concatenate(DatePicker1_2.SelectedDate, " ", If(Toggle1.Value=true,"23:59:59",TextInput7_2.Text)),
{search:Concatenate("Event: ",adsComboboxEvents_2.Selected.structureName)}
).value
)
},
Office365Outlook.V3CalendarPatchItem(
calendarID,//Here you should replace the dot with the comma ","
idCalendarEntry.id,
"New Subject Text",
Concatenate(DatePicker1_1.SelectedDate, " ", If(Toggle1.Value=true,"00:00:00",TextInput7_1.Text)),
Concatenate(DatePicker1_2.SelectedDate, " ", If(Toggle1.Value=true,"23:59:59",TextInput7_2.Text)),
{Body:"Updated calendar entry body text"}
)
)
Thanks for the help. Unfortunately, the problem is still there.
HI @a-mccormack,
Do you mean you set the calendarID as I suggested and the issue is still?
Could you please show me your formula?
Please make sure that you have replace the dot with comma.
This is the code I'm using right now that doesn't work. This is supposed to make changes to the event.
With({idCalendarEntry:
First(
Office365Outlook.GetEventsCalendarViewV3("AAM <rest of calendar ID here > ,
Concatenate(DatePicker1_1.SelectedDate, " ",
If(Toggle1.Value=true,"00:00:00",TextInput7_1.Text)),
Concatenate(DatePicker1_2.SelectedDate, " ", If(Toggle1.Value=true,"23:59:59",TextInput7_2.Text)),
{search:Concatenate("Event: ",adsComboboxEvents_2.Selected.structureName)}
).value
)
},
Office365Outlook.V4CalendarPatchItem(
"AAM <rest of calendar ID here >",
idCalendarEntry,
"New Subject Text",
Concatenate(DatePicker1_1.SelectedDate, " ", If(Toggle1.Value=true,"00:00:00",TextInput7_1.Text)),
Concatenate(DatePicker1_2.SelectedDate, " ", If(Toggle1.Value=true,"23:59:59",TextInput7_2.Text)),
"(UTC-08:00) Pacific Time (US & Canada)",
{Body:"Updated calendar entry body text"}
)
)
But it works here when deleting an event.
With({idCalendarEntry:
First(
Office365Outlook.GetEventsCalendarViewV3(
"AAM < rest of calendar ID here >",
Concatenate(DatePicker1_1.SelectedDate, " ", If(Toggle1.Value=true,"00:00:00",TextInput7_1.Text)),
Concatenate(DatePicker1_2.SelectedDate, " ", If(Toggle1.Value=true,"23:59:59",TextInput7_2.Text)),
{search:Concatenate("Event: ",adsComboboxEvents_2.Selected.structureName)}
).value
)
},
Office365Outlook.CalendarDeleteItemV2 (
"AAM < rest of calendar ID here >",
idCalendarEntry.id
))
Thanks again,
User | Count |
---|---|
158 | |
91 | |
68 | |
63 | |
63 |
User | Count |
---|---|
210 | |
155 | |
93 | |
81 | |
71 |