Official Site
Microsoft Most Valuable Professional M365 Apps & Services
Microsoft Most Valuable Professional Business Applications
Consultant & Sr Cloud Solution Architect Modern Wokrplace
Find hereMore than 150 Articles about Microsoft Technologies on Modern Workplace
28 April 2024
In today's article, we will see how we can use Power Automate and an HTTP request to retrieve a JSON with information about list content types in SharePoint and all related information. This is a very easy process that requires only two actions. Obviously, this is not a standalone process but can be part of a complex automation where at some point during execution, we extract this information and use it later.
First, you need to have an active M365 subscription and log in to your account. Then, navigate to the Power Automates page and select "Create" on the left. From the available options, choose "Instant cloud flow."
In the next step, select "Manually trigger flow" since we will trigger the flow manually and give a name to our automate.
In the first action, we need to set the parameter to trigger the flow.
For the second action, select "Send an HTTP request to SharePoint." In the Site address, enter the address of the site where our list is stored. The method we choose is GET, and the URI is _api/web/lists since it is about list information.
In the headers of the request, enter:
• Accept: application/json;odata=nometadata
• Content-Type: application/json
In the body of the request, enter:
{
"Parameters": {
"RenderOptions": 17
}
}
The RenderOptions parameter in Power Automate's HTTP request action is used to specify how the response should be formatted. In the context of SharePoint, it can control various aspects of the data returned by the API. For example, setting RenderOptions to 17 can be used to include additional metadata in the response, such as the content types of the list and other related information.
This parameter is particularly useful when you need detailed information about a SharePoint list, including its structure and properties, which can be essential for complex automation scenarios. By using RenderOptions, you can tailor the response to include the specific details you need for your workflow.
In the next step, we will save our automate
and select to manually execute our automate.
Then, select "Continue" to allow the connection with SharePoint
Then, select "Run flow."
Our flow has been successfully executed.
If we go to the parameters of the request, we will see what we have received as a response after the request we sent to SharePoint regarding our list.
If we choose to open the body of the JSON we received as a response, you will see that it contains all the relevant information about the content types in our lists.
Visit Archives below to find more articles about Microsoft technologies on Modern Workplace