Skip to main content

Open Graph Extensions with SPFx

Following on from my previous post titled “Using Microsoft Graph Open Extensions with PowerApps” I challenged myself to recreate the same example using a SPFx web part. To read more about what Open Graph Extensions are please read the previous post.

How did the experience compare?

Although creating a SPFx web part is markedly different and requires coding skills compared to a low code solution such as PowerApps, there are some benefits;

·       You don’t need to create a Azure App Registration

·       You don’t need to create Custom Connectors

·       You don’t need a premium PowerApps Licence

You can view the full solution via the link below, but here are the most important elements of the web part;

Graph Scopes

The following graph permissions are required and will need to be approved in the API Permissions;

·       User.Read

·       User.ReadWrite

Graph Calls

The web part makes the following four Graph calls;

Create

Creates an Open Graph Extension named “com.bestranet.roamingSettings” with a property named “plane”.

Verb

POST

Endpoint

/v1.0/me/extensions

Body

{

  "@odata.type": "#microsoft.graph.openTypeExtension",

  "extensionName": "com.bestranet.roamingSettings",

  "plane": "Concorde"

};

 

Read

Retrieves an Open Graph Extension named “com.bestranet.roamingSettings”

Verb

GET

Endpoint

/v1.0/me/extensions/com.bestranet.roamingSettings

Body

n/a

 

Update

Updates an Open Graph Extension named “com.bestranet.roamingSettings”

Verb

PATCH

Endpoint

/v1.0/me/extensions/com.bestranet.roamingSettings

Body

{

  "@odata.type": "#microsoft.graph.openTypeExtension",

  "extensionName": "com.bestranet.roamingSettings",

  "plane": "Concorde"

};

 

Delete

Deletes an Open Graph Extension named “com.bestranet.roamingSettings”

Verb

DELETE

Endpoint

/v1.0/me/extensions/com.bestranet.roamingSettings

Body

n/a

The full solution can be found here

Comments

Popular posts from this blog

Replace Power Automate Approval Emails with Adaptive Cards in Microsoft Teams

Microsoft recently released a personal app for Approvals within Teams. Please review this before investing time implementing something customized. If you are still interested in creating a custom adaptive card for an approval process check out the following blog for which this blog is a good precursor. With Microsoft Teams becoming an increasingly dominant force in collaboration, and one objective being the reduction of email, this blog covers how you can simply replace approval email notifications with dynamic adaptive cards in Teams. So, how does it work? I have created a sample SharePoint list using the “ Travel requests ” template and associated it with my Team as shown below. Within Microsoft Power Automate I have created an “ Automated cloud flow ” using the “ When an item is created ” trigger. The next step is to add the “ Create an approval ” action. I have personally configured this action as follows. Notice how I have set the “ Enable notifications ” to “ No ”. This wil

Customize list forms in SharePoint with JSON formatters

Back in the days of classic SharePoint we had a few options to customize list forms, such as JSLink. Up until recently our options to customize list forms in modern SharePoint were somewhat limited. Sure, we could use JSON to apply custom formatting to views and columns, but unless we leveraged tools, such as PowerApps or SPFx Application Customizers, it was impossible to style list forms. Microsoft has recently introduced JSON formatters for list forms and I think they are great, especially for requirements where a simple header or footer change may be required. In this blog we will cover what JSON formatters are, how we can leverage them and some useful examples to support our understanding. What are JSON formatters? When Microsoft introduced the modern version of SharePoint, capabilities like JSLink were no longer compatible and became obsolete. JSLink was useful because it allowed us to customize list views, forms and columns, and for some time there was a void until Micros

Create Customized Adaptive Cards for Power Automate Approvals in Microsoft Teams

Microsoft recently released a fantastic new feature with which we can action approval requests directly in Teams. This is great news, and no doubt moves us further away from the days of having to trawl through our email to locate an old approval request. But, what customization options are available for approval requests? Can we change the way these look? And can we create our own version of the approval adaptive cards? This blog covers how you can create a customized version of the adaptive card for Power Automate approvals. So, how does it work? Firstly, we need to look at the json payload that generates the out-of-the-box approval adaptive card. This can be extracted by initiating a variable of type string and then adding and configuring a “ Create an approval ” action. We will then set the value of our variable to “ Teams Adaptive Card”. Our flow should look like the following If we now test run the flow and check the value of our variable, we should see the json payload in the &q