Recently, I worked on a project where I needed to create the same custom view in multiple SharePoint lists. Doing it manually each time was time-consuming and not ideal, so I decided to automate the process using Power Automate and the SharePoint REST API.
In this tutorial, I will show you how to create custom SharePoint list views, whether filtering by choice columns, applying AND/OR conditions, or sorting data.
Create a View in SharePoint List Using REST API
To create a view in a SharePoint list using the REST API, we will use the Send an HTTP request to SharePoint action in Power Automate. This action allows us to communicate directly with SharePoint and perform actions, such as creating custom views, by sending the appropriate REST API call.
SharePoint uses an object called SP.View to define and manage views on a list. This object allows us to set options such as the view name, filters, columns to display, and more.
For this tutorial, I will use a SharePoint list called Support Tickets. The screenshot below shows its structure.

Let’s see how to create the view in SharePoint List using REST API:
SharePoint List View Using a Choice Column with a Filter
Here, I need to create a view that filters list items based on a specific value selected in a Choice column (Priority equals High).
- Go to Power Automate and create a new instant cloud flow by manually triggering a flow trigger.
- Add a Send an HTTP Request to SharePoint action and provide the below parameters:
- Site Address: Select the SharePoint site address.
- Method: Use the POST method to create the view in the SharePoint list.
- Uri: Provide the URI as below, required to do the REST API call:
_api/web/lists/GetByTitle('List Name')/Views
- Headers: Provide the headers as shown below, as they are required to make the REST API call.
{
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose"
}
- Body: Provide the below json code:
{
'__metadata':{
'type': 'SP.View'
},
'Title':'High Priority',
'ViewQuery':'<Where><Eq><FieldRef Name="Priority" /><Value Type="Text">High</Value></Eq></Where> '
}
- __metadata: This part tells SharePoint what type of object is being referenced—in this case, it’s a “view.”
- Title: This is the name of the view. In this example, the view is named “High Priority.”
- ViewQuery: This is where the actual filtering happens. It defines a query that filters items based on their “Priority” field. The condition in the query is:
- <Where>: This is the start of the filtering condition.
- <Eq>: This means “equals.” So it’s checking if the field meets a specific value.
- <FieldRef Name=”Priority” />: This refers to the “Priority” field in the SharePoint list.
- <Value Type=”Text”>High</Value>: This specifies that the value being checked for in the “Priority” field is “High.”

- Then, save the flow and run it manually.
- Once the flow runs successfully, navigate to the SharePoint list and view the newly created list. Then, click the list view to see tasks with a high Priority.

This way, you can create a view in SharePoint List using the REST API in Power Automate.
Create Custom List Views with Multiple Conditions Using REST API
This example shows how to create a SharePoint list view based on multiple conditions using the REST API.
Here, I will cover two different Conditions, which are the AND condition and the OR condition:
List Views With AND Condition
Here, I will create a view that displays only tickets with an ‘Open’ status and a ‘Low’ priority.
- Create an instant cloud flow with a trigger: Manually trigger a flow.
- Then, send an HTTP request and provide the following required parameters to SharePoint to create the view:
- Site Address: Select the SharePoint Site Address.
- Method: Select POST as the method.
- Uri: Provide the below URI:
_api/web/lists/GetByTitle('List Name')/Views
- Headers: Click on the Switch to text mode button to input the json. Copy and paste the code below in the Headers section.
{
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose"
}
- Body: Provide the below json code to create the view.
{
'__metadata':{
'type': 'SP.View'
},
'Title':'Open status and Low priority',
'ViewQuery':'<Where><And><Eq><FieldRef Name="Status" /><Value Type="Text">Open</Value></Eq><Eq><FieldRef Name="Priority" /><Value Type="Text">Low</Value></Eq></And></Where> '
}

- Now, run the flow. After the flow runs successfully, you can see the result below when you go to the list and click the “Open status and Low priority” view.

If you want to add more conditions, you can extend the <And></And> section in the ViewQuery. For example, if you also want to filter by “Category” being “Support”, you can add another <Eq></Eq> condition inside the <And></And> like this:
<Where>
<And>
<Eq><FieldRef Name="Status" /><Value Type="Text">Open</Value></Eq>
<Eq><FieldRef Name="Priority" /><Value Type="Text">Low</Value></Eq>
<Eq><FieldRef Name="Category" /><Value Type="Text">Support</Value></Eq>
</And>
</Where>
This way, you can add as many conditions as needed to filter your SharePoint list.
List Views With OR Condition
In this example, we will use Power Automate and the SharePoint REST API to create a new list view in the Support Tickets list that shows only items with a Status equal to Open or Resolved.
So let’s get to it!
- Open the Power Automate Home page and choose Instant cloud flow with trigger Manually trigger a flow.
- To create the view using Power Automate, use the Send an HTTP request to SharePoint action with the following parameters:
- Site Address: Your SharePoint site URL
- Method: POST
- Uri:
_api/web/lists/getbytitle('Support Tickets')/views
- Headers:
{
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose"
}
- Body:
{
'__metadata':{
'type': 'SP.View'
},
'Title':'Open or Resolved',
'ViewQuery':'<Where><Or><Eq><FieldRef Name="Status" /><Value Type="Text">Open</Value></Eq><Eq><FieldRef Name="Status" /><Value Type="Text">Resolved</Value></Eq></Or></Where> '
}

- Then, save the flow and run it manually. Once the flow runs successfully, you can navigate to your Support Tickets list and view a new section named Open or Resolved. This view displays only items with the Status Open or Resolved.
- If you are using the same flow, you will see a response similar to the screenshots below, indicating that the HTTP request ran successfully and the view was created.

List View with Sort List Items in Ascending or Descending Order
In the previous examples, we saw how to create a list based on filters. Now, I’ll show you how to create a list view in ascending or descending order.
For example, let’s say you want to create a view in the Support Tickets SharePoint list that sorts the items by the Ticket ID column in descending order.
Now follow the steps below:
- Go to Power Automate -> Click Create -> choose Instant cloud flow -> Give your flow a name -> Choose Manually trigger a flow -> Click Create.
- Add the “Send an HTTP request to SharePoint” action and use the following details:
- Site Address: Your SharePoint site (where the Support Tickets list exists)
- Method: POST
- URI:
_api/web/lists/getbytitle('Support Tickets')/views
- Headers:
{
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose"
}
- Body:
{
"__metadata": {
"type": "SP.View"
},
"Title": "Sorted",
"ViewQuery": "<OrderBy><FieldRef Name='TicketID' Ascending='FALSE' /></OrderBy>"
}

- Click Save and Click Run. Once the flow runs successfully, a new view named Sorted will be created in your Support Tickets list. It will display the items sorted by TicketID in descending order (from highest to lowest).

In the same way, you can sort the list items in ascending order by changing just one part in the body.
"ViewQuery": "<OrderBy><FieldRef Name='TicketID' Ascending='TRUE' /></OrderBy>"
This will create a view where the items are sorted by TicketID in ascending order (from lowest to highest).
You may also like:
- REST API Calls in Power Automate
- Rename SharePoint Folder Or File Using REST API Power Automate
- Send Email Using REST API in Power Automate
- SharePoint Rest API [Complete Tutorial With Examples]
- Delete Files From SharePoint Document Library Using Rest API

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.