Advanced | Flow of the Week: Post the on-call engineer list to a OneNote Page on a weekly basis
Today, I'll describe another flow that we use internally and describe some of the advanced concepts used in the flow.
Internally at Microsoft, we use a system call Incident Call Manager (ICM) to handle live site servicing rotation and service outage notifications. Mulitple Microsoft Teams use ICM for the devOps/Live site rotations with different engineers on call for differing periods. As part of handling service outages and investigations, frequently we need to look up the engineers on call for a different service to get help. The Flows team (as is true for mulitple teams) needs to interact with mutliple partner teams while investigating incidents. Its pretty common for us to lookup who the onCall engineer is for a particular service – the flow I describe makes saves time for our OnCall engineers by updating an OneNote with the onCall lists for multiple teams each week.
The flow I describe users a Custom API that's published internally within the Microsoft tenant to talk to the ICM service, builds up a HTML table of all partner teams we typically interact with and updates a section in One Note weekly so we have a handy place to look up the onCall engineers for the team we interact with.
The flow is shown below
The flow calls the ICM connector mutliple times, gets the onCalls for a particular service – you can see in the picture above that calls are made for the Flow Service followed by PowerApps RP, and then API Hubs service and so on.
Note that there's a compose action that processes the results of the JSON object returned by the connector for each ICM service – as shown below – I do that becuase I needed to transform the JSON object returned by the service to add an addiontal field. Take the flow team snip below
The JSON object returned by the ICM connector looks like this – Notice that I'm pulling "TeamName", "Email" and "Name" fields from mutliple JSON objects in the original payload and converting it to a new JSON object that only has these fields that I'm interested in as shown below. – Lets call these JSON objects the full ICM Objects. At the end of the flow, I have a bunch of these JSON objects for different services and I need to process them to create a HTML table.
I use the handy union function as describe here(https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language) in the compose card at the end to create an single array of these JSON objects to parse to the create HTML table
Then I use the CreateHtML to create a html table of the JSON objects and write to a One Note section. Noe that OneNote requires a html snipped to properly create and name the title of the page – Like so
At the end – In One note you see these cool entries every week!
I hope this was useful, important topics covered here:
How to extend a JSON object in building the full onCall JSON object.
Combining JSON objects using the union function and how to create sections in OneNote.