Retrieving the JSON Web Part Data
The modern Ensure Web Part
building block allows you to add any client side web part to a modern SharePoint page if we have no OOTB support for it.
This is done by extracting the JSON data from an existing instance of the web part and using it as the input for the Ensure Web Part
building block.
This article will take you through the steps necessary for extracting the JSON data.
1. Create the Web Part You Want to Retrieve the Json Data From
Before we can retrieve the JSON data from the web part, add it to a modern page and configure it just the way you would like the building block to do it. In this example you can see a Bing Maps is configured with the Pin Label and Address to display filled. The map is also placed at the location I want the building block to ensure it.
2. Enter the Maintenance Mode on a Page
To view the web part JSON data of the page and the web parts on the page, we need to enter the maintenance mode of the page.
Add maintenancemode=true at the end of the URL of the page. For example https://[yourtenant].sharepoint.com/sites/my-awesome-site/SitePages/Home.aspx?maintenancemode=true.
3. Retrieving the Web Part Data
After we have entered maintenance mode of the page, we can see all technical details of the page and the web parts on it.
Go to the web part you want the JSON data from, click on the tab Data.
This tab contains the JSON data of the web part. You can copy this and use it as the value for the Web Part JSON Data
input field of the Ensure Web Part
building block.
In this example all properties of the location and the settings in the property pane are stored in the JSON data.
Note
Make sure to replace static links in de JSON data with your site link or a field token used in case management.