Can the Event ID for two or more events be the same for any user in Outlook Calendar API? - outlook-calendar

I am using outlook calendar api to manage users calendar on a CRM. And as per my knowledge, event ID's for any user are always unique for the events on their calendar. But, in some cases, when I fetch the events for a time window, I get two events with same event ID in the response from the server (till now, I'm getting one SeriesMaster and one SingleInstance). e.g., Please have a look on two events of the same user.
1st event is:
"Start":{"DateTime":"2016-07-13T15:00:00.0000000","TimeZone":"UTC"},"End":{"DateTime":"2016-07-13T15:30:00.0000000","TimeZone":"UTC"},"Location":{"DisplayName":"","LocationType":"Default","UniqueIdType":"Unknown","Address":{"Type":"Unknown"},"Coordinates":{}},"Locations":[],"Recurrence":{"Pattern":{"Type":"Weekly","Interval":1,"Month":0,"DayOfMonth":0,"DaysOfWeek":["Monday","Tuesday","Wednesday","Thursday","Friday"],"FirstDayOfWeek":"Sunday","Index":"First"},"Range":{"Type":"NoEnd","StartDate":"2016-07-13","EndDate":"0001-01-01","RecurrenceTimeZone":"Eastern Standard Time","NumberOfOccurrences":0}},"Attendees":[{"Type":"Required","Status":{"Response":"None","Time":"0001-01-01T00:00:00Z"},{"#odata.id":"https://outlook.office.com/api/v2.0/Users('4f3a5396-c4e1-4f96-9d47-88efd09cf7d5#69e9fa32-18c7-4580-8b68-5042cb060d21')/Events('AQMkADlhNWMwNTJiLTUxOWQtNDBlZC05MWExLWMxNjRmZWY3ZDE3NABGAAAD5qmKtv6ZXUGI6fp4FLgPGwcAc0VsZLFXUEWDJV8jau5I2AAAAgENAAAAc0VsZLFXUEWDJV8jau5I2AAAAdBPbQAAAA==')","#odata.etag":"W/\"c0VsZLFXUEWDJV8jau5I2AAAIehEGA==\"","Id":"AQMkADlhNWMwNTJiLTUxOWQtNDBlZC05MWExLWMxNjRmZWY3ZDE3NABGAAAD5qmKtv6ZXUGI6fp4FLgPGwcAc0VsZLFXUEWDJV8jau5I2AAAAgENAAAAc0VsZLFXUEWDJV8jau5I2AAAAdBPbQAAAA==","CreatedDateTime":"2018-03-12T01:49:57.8583046Z","LastModifiedDateTime":"2018-05-02T18:46:31.9407131Z","ChangeKey":"c0VsZLFXUEWDJV8jau5I2AAAIehEGA==","Categories":[],"OriginalStartTimeZone":"Eastern Standard Time","OriginalEndTimeZone":"Eastern Standard Time","iCalUId":"040000008200E00074C5B7101A82E008000000005047993733DCD101000000000000000010000000E97F92FB0575724C8DFBC43970F08489","ReminderMinutesBeforeStart":15,"IsReminderOn":true,"HasAttachments":false,"Subject":"APPT","BodyPreview":"","Importance":"Normal","Sensitivity":"Normal","IsAllDay":false,"IsCancelled":false,"IsOrganizer":true,"ResponseRequested":true,"SeriesMasterId":null,"ShowAs":"Busy","Type":"SeriesMaster"
and, 2nd event is:
"Start":{"DateTime":"2018-05-03T19:00:00.0000000","TimeZone":"UTC"},"End":{"DateTime":"2018-05-03T19:30:00.0000000","TimeZone":"UTC"},"Location":{"DisplayName":"","LocationType":"Default","UniqueIdType":"Unknown","Address":{"Type":"Unknown"},"Coordinates":{}},"Locations":[],"Recurrence":null,{"#odata.id":"https://outlook.office.com/api/v2.0/Users('4f3a5396-c4e1-4f96-9d47-88efd09cf7d5#69e9fa32-18c7-4580-8b68-5042cb060d21')/Events('AQMkADlhNWMwNTJiLTUxOWQtNDBlZC05MWExLWMxNjRmZWY3ZDE3NABGAAAD5qmKtv6ZXUGI6fp4FLgPGwcAc0VsZLFXUEWDJV8jau5I2AAAAgENAAAAc0VsZLFXUEWDJV8jau5I2AAAAdBpbQAAAA==')","#odata.etag":"W/\"c0VsZLFXUEWDJV8jau5I2AAAIehD6A==\"","Id":"AQMkADlhNWMwNTJiLTUxOWQtNDBlZC05MWExLWMxNjRmZWY3ZDE3NABGAAAD5qmKtv6ZXUGI6fp4FLgPGwcAc0VsZLFXUEWDJV8jau5I2AAAAgENAAAAc0VsZLFXUEWDJV8jau5I2AAAAdBpbQAAAA==","CreatedDateTime":"2018-05-02T18:19:45.1643323Z","LastModifiedDateTime":"2018-05-02T18:25:39.7135811Z","ChangeKey":"c0VsZLFXUEWDJV8jau5I2AAAIehD6A==","Categories":[],"OriginalStartTimeZone":"UTC","OriginalEndTimeZone":"UTC","iCalUId":"040000008200E00074C5B7101A82E008000000004F75B80342E2D3010000000000000000100000005F993094248CD348815FEDB972AC66C8","ReminderMinutesBeforeStart":15,"IsReminderOn":true,"HasAttachments":false,"Subject":"Alternate Health- Modern Business","Importance":"Normal","Sensitivity":"Normal","IsAllDay":false,"IsCancelled":false,"IsOrganizer":false,"ResponseRequested":true,"SeriesMasterId":null,"ShowAs":"Busy","Type":"SingleInstance"

Those are not the same. I'm guessing you're comparing in a case-insensitive manner. However, IDs of items are case-sensitive.

Related

With MS Graph API is there a way to search a group calendar and return meeting time even if only one of the group member is available?

I have to create a Microsoft Graph API to search a group's calendar. But want to have a meeting with any one person available at that time. What would be the possible way to do that?
You can use either Findmeetingstimes() or GetSchedule() to do so - they will return you the availability info for the users.
If you believe this a new feature which Microsoft needs to consider
implementing, then file a Microsoft uservoice; here's the link for it.

Query Outlook Calendar for Locations on Events

Does anyone know if there is a way to retrieve locations on calendar events? It looks like the api currently only allows users to see title and start/end date on the event. I would like to be able to see the conference room location. Thanks!
Outlook Calendar REST API
When you query for events, you will always get the location back as well as the organizer, attendees, ...
Try the following api, for example:
https://outlook.office365.com/api/v2.0/me/calendarview?startDateTime=2017-07-01T00:00:00Z&endDateTime=2017-07-31T23:59:59Z&$top=10
or if you know the event ID, then you can use the following api:
https://outlook.office365.com/api/v2.0/me/events/[eventID]

Database design for recurring events with exceptions

I'm building a system that needs to store/manage different types of events. For simplicity, I will focus on designing a calendar (I'm building something slightly different, but calendar is a good analogy and it's easy to reason about). I'd like to hear about possible database/schema design ideas.
Problem Description
I have a calendar with different types of events (for simplicity sake, say there is only 1 type of event: Task). User can add new event for a particular date, edit (change some details, like title or move to another date) or delete. There can be one-time events and recurring events (with different types of recurrence: every X days, every 15th day of the month, every week on Monday; kind of like simple cron). When user moves recurring event, all other instances of this event are moved in the same manner (e.g: +3 days). Important part: recurring events can have exceptions. So, for example, let's say I have an recurring event A which is repeated every 7 days. But I want to change it's date for next week, so instead of Tuesday, it's be assigned to Friday, after that it'll still occur on Tuesday. This "exception" event shouldn't be affected when "parent" event is moved.
Also, every recurring event can have additional info, that is related only to 1 particular instance, e.g: I have the same recurring event A repeated every 7 days, I want to add a note for this week instance that says "X", and I want to add another note for the event A next month that says "Y" - those fields are only visible to that single instances.
Ideas
System with regular, one-time events is pretty straightforward so I won't discuss that and focus only on recurring events.
1. One possible solution is the one that resembles OOP: I can have an Event "class" with fields such as start_date, end_date (can be null), recurrence_type (something like enum with possible values of EVERY_X_DAYS, DAY_OF_WEEK, DAY_OF_MONTH) and recurrence_value (say 7). When user adds new recurring event, I just create such Event in the database. When user wants to change 1 occurrence of this event, I add new entry to the DB of the type/class MovedEvent that "inherits" from Event with different date and has additional field related_to that points to the ID (or UUID, if you will) of the Event that it's related to. But at the same time, I need to keep track of all the MovedEvents (otherwise I'd have 2 events displayed in the same week), so I need to have an array moved_events of IDs that point to all MovedEvents.
Disadvantage: every time I want to display the calendar I need to get Event and select all events from the moved_events, which is not optimal if I'll have a lot of moved events.
2. Another idea is to store every event as a separate record. IMO it's a terrible idea, but I just mentioning it because it's a possibility. Disadvantages: every time I want to edit the main event (e.g: I want to change the event from occurring "every 7 days" to "every 9 days") I need to change every single occurrence of the event. "Exceptions" (changing single instance) is easier, though.
SQL/NoSQL? Scale details
I'm using PostgreSQL in my project, but I have basic knowledge in NoSQL databases and if they are better suited for this kind of a problem, I can use it.
Scale: Let's say I have 5k users, and each will have on average 150 events/week, 40% of which can be "exceptions". Therefore I want to design this system to be efficient.
Similar Questions & Other Resources
I've just started reading Martin Fowler's "Recurring Events for Calendars" (http://martinfowler.com/apsupp/recurring.pdf) but I'm not sure if it applies to my problem and if so, how one would design database schema according to this document (suggestions are welcome).
There are similar questions, but I didn't see any mention of "exceptions" (changing 1 event instance without affecting other), but maybe someone will find these links useful:
Design question: How would you design a recurring event system?
Optimal design for a Database with recurring event
Design option for 'recurring tasks'
Calendar Recurring/Repeating Events - Best Storage Method
What is the best way to represent "Recurring Events" in database?
Sorry for a long question, I wanted to describe the problem well. Yet, I feel that's pretty chaotic, so if you have additional questions, I will happily provide more details. Again, I'd like to hear about possible database/schema design ideas plus any other suggestions. Thank you!
Use iCalendar RRules and ExDates
If it's a recurring event, just store the start/end datetimes and RRules and ExDates for the event.
Use a Materialized View to pre-calculate upcoming actual events, say for the next 30 days or 365 days.
As you are using Postgres, you can use existing python, perl, or javascript RRule libraries (such as dateutil) inside pg function for calculating future events based on the rrules and exdates
UPDATE: check out pg_rrule extension: https://github.com/petropavel13/pg_rrule

How to set Custom Fields Notifications in HP Project and Portfolio Management(PPM)?

I am using HP Project and Portfolio Management(PPM) tool and I am adding a custom field in my request type which has date as value. Now my requirement is to send the email notifications to the users once the date mentioned in the custom field crosses the system date.
I had tried to set the notification for field level from Notification tab but not getting the custom fields in the list. All the fields, which is available, are pre-configured fields.
So, can anyone suggest me how to implement this requirement? And also where the changes need to be done If any required to implement this?
Please answer in detail and also reply soon.
Thanks in advance!!
PPM notifications can be configured on pre-defined events, like a certain transition, or timeout etc...
One possible solution for this scenario is to have timeouts on your decision step. Time out goes to an execution step, which checks for the date condition. If the condition is met it fires the notification. Else it just returns to the original decision step.
The downside of this work around is that there will be transaction details added once daily. Also the last update date of the request keeps updating daily, which is not ideal if you want to track what was the last time an end user update the request.
It is a workaround cause of the restrictions around notification events.
And if you have a large workflow, I would not recommend this work around.

Trello: how to generate an activity report using card list change dates

In an effort to unify and automate my activity report across multiple projects I am trying to generate a timeline-like report from several Trello boards.
An event on the timeline would be generated when a card is moved into the "Doing" list, with the time of list change as the start date.
The end date stays at the current date until the card is moved to the "Done" list at which point it's set to the date on which the activity was completed.
I've looked at some tools to connect Trello activity to Google Calendar, so far with no success:
Trello powerups: only provides due dates when connecting to the calendar
IFTTT - doesn't seem to provide Trello as a recipe source
Zapier - Only provides due date and last activity dates as source values
Ducksboard - No template available for this kind of visualisation
Ideally, an "API catalyst" like the ones listed above would be the best solution, alternatively any other suggestion on how to approach the problem using other tools is very welcome (I have a little experience with d3.js).
Just do it yourself with their API, you can check the guide.
Here's my algorithm for a similar task where I show which cards were having that user as a member, so basically it's like "which cards have I been working on yesterday?" report.
Connect Trello SDK;
Authorize user (only read permissions) when he clicks a button (so the popup doesn't get blocked);
Fetch /tokens/[token] endpoint to figure out the user's memberID;
Fetch /members/[memberID]/actions for a required period filtering only by addMemberToCard,removeMemberFromCard actions;
Run a loop over resulting array to figure out datetime difference between addMemberToCard and removeMemberFromCard for every card in the response;
Format everything and show to the user!
As an example, here's my realization of it: Trello Activity Report
Code is here: https://github.com/pistonsky/trello-activity-report
P.S. Instead of using addMemberToCard and removeMemberFromCard action types, you can filter by updateCard:idList and calculate the datetime difference between when card is moved from To Do to Done list.