Search code examples
microsoft-graph-apipower-automatemicrosoft-graph-calendar

Set "charm" icon for Outlook365 using Power Automate or MS Graph API


I want to create events in Outlook365 calender where I specify the category and the charm icon (i.e. phone icon for calls, repair icon for tasks, etc.; as they are available in the calendar in the browser) using PowerAutomate or the Graph-API.

An event with a charm would look like this.

enter image description here

At least I managed to set the category using a HTTP patch request when following the guide here: https://www.cloudappie.nl/lowcode-categorize-meetings-outlook/

I tried to set the charm icon the same way, but I wasn't able to find the appropriate keyword or any other way to set the charm icon in the MS Graph API documentation.

The only other resource I was able to find, and that is closest to what I try to do, was an issue on GitHub, but that issue was closed with the hint to ask on stackOverflow... and I cannot find anything as as related.


Solution

  • You can get and set the Charm in the Graph using Extended properties as there is no strongly typed value for this. eg to get the charms on item use

    https://graph.microsoft.com/v1.0/me/events?$expand=singleValueExtendedProperties($filter=id eq 'Integer {11000E07-B51B-40D6-AF21-CAA85EDAB1D0} Id 0x27')

    and if you want to set one you use

    {
        "singleValueExtendedProperties": [
            {
                "id": "Integer {11000e07-b51b-40d6-af21-caa85edab1d0} Id 0x27",
                "value": "Car"
            }
        ]
    }

    I don't know of any documented list of values for charm so you just need to find the value from an existing item where its set.

    While the above works okay there is some weirdness in the Graph around this property that could be considered a bug. Eg the property in question is a Integer property and if you look at it in MAPI it has a integer value. Requesting and setting in using the Graph requires and returns a string which it shouldn't do based on it property type.