
Hi All...
I have a Powerapp (demo) collecting booking information. The booking date is stored in Sharepoint along with a field with booking length in Mins (stored as a number).
Sharepoint fields are:
I then have this code to create a record in Outlook, but i need to know how I change this so that the date time is store in UK format.
Current code:
Office365Outlook.V4CalendarPostItem(
LookUp(Office365Outlook.CalendarGetTables().value, DisplayName="Calendar").Name,
ThisItem.Title,
DateAdd(ThisItem.TimeSlot,TimeZoneOffset(), Minutes),
DateAdd(ThisItem.TimeSlot, ThisItem.SlotLength + TimeZoneOffset(), Minutes),
"(UTC) Coordinated Universal Time",
{
body: "Meeting created with PowerAppps"
}
)
Presently, a booking for 12th August is saving a record on the 8th December.
Can anyone advise how I need to change this to save in UK timezone in Outlook please? It should create a 60 min meeting on 12th Aug.
Many thanks.
Paul
I seem to have resolved this now. Here's my fix if this is useful to others.
Set(varStartDate, Text(ThisItem.TimeSlot, "[$-en-GB] dd/mm/yyyy hh:mm:ss"));
Set(varEndDate, Text(DateAdd(ThisItem.TimeSlot,ThisItem.SlotLength, Minutes), "[$-en-GB] dd/mm/yyyy hh:mm:ss"));
Office365Outlook.V4CalendarPostItem(
LookUp(Office365Outlook.CalendarGetTables().value, DisplayName="Calendar").Name,
ThisItem.Title,
Text(DateTimeValue(varStartDate,"en-GB"), DateTimeFormat.LongDateTime),
Text(DateTimeValue(varEndDate, "en-GB"), DateTimeFormat.LongDateTime),
"(UTC+00:00) Dublin, Edinburgh, Lisbon, London",
{
body: "Meeting created with PowerAppps"
}
)