Live training: next batches coming soon. Join the waitlist:Waitlists open:Developer Training →Developer →Copilot Studio Training →Copilot Studio →

How to Get and Delete a SharePoint List View Using Power Automate

A project manager on our SPGuides site had a task list with views nobody remembered creating. She wanted a quick way to see every view and remove the dead ones without opening list settings each time.

So I built a small flow for it, and one of my test runs threw an error that most guides get wrong.

In this tutorial, we’ll get and delete a SharePoint list view using Power Automate. The flow lists every view on a list, finds one view by its name, refuses to touch the default view, and deletes the rest with a single REST call.

We’ll also handle the case where the view name doesn’t exist, and I’ll show the quick way to delete a view in SharePoint itself when you don’t need a flow at all.

Here’s what we’re building: one instant flow with three SharePoint calls, a GET for all views, a GET for one view by title, and a DELETE that only runs when the view isn’t the default.

Finished Power Automate flow that gets all SharePoint list views, gets one view by title and deletes it if it is not the default view
  • Get all views returns the name, ID and default flag of every visible view.
  • Get view by title looks up the view name you type when you run the flow.
  • Delete view removes that view by its GUID, but only when it isn’t the default view.

Every result below comes from three real runs on 11/01/2026.

Before You Start

You need a Power Automate license that includes the standard SharePoint connector (Microsoft 365 plans do) and at least Edit permission on the list. The flow runs as you, so it can only delete views you could delete yourself. If REST calls are new to you, skim our guide to REST API calls in Power Automate first.

My sample list is SPGDemo Project Tasks on the /sites/SPGuides site. It has five public views:

View nameDefault view?Used in test
All ItemsYesRun 2 (the flow must keep it)
Open TasksNo–
High PriorityNo–
Tasks by DepartmentNo–
Due in 30 DaysNoRun 1 (deleted)

I created these views with a flow too. If you want the same setup, follow our post on creating SharePoint list views using Power Automate.

Important: practice on a test list, because the flow has no undo step. Deleting a view never deletes list items, only the saved layout and filter.

Step 1: Create an Instant Flow With a View Name Input

We start with a flow you run by hand, so you can type the view name each time.

  1. Go to make.powerautomate.com and select Create > Instant cloud flow.
  2. Name it SPGuides Demo – Get and delete list view.
  3. Pick Manually trigger a flow and select Create.
  4. Select the trigger, choose Add an input > Text, and name the input View name.
Build an instant cloud flow dialog with the flow name entered and Manually trigger a flow selected

Checkpoint: the designer shows Manually trigger a flow with one text input called View name.

Step 2: Get All Views With a REST Call

There’s no built-in SharePoint action for list views, so we call the SharePoint REST API directly. Microsoft’s connector reference says this action can run any SharePoint REST API you have access to, which is why I keep it to one list.

  1. Select + under the trigger, search for Send an HTTP request, and pick the SharePoint action Send an HTTP request to SharePoint.
  2. Rename it Get all views (the name matters, because later expressions use it).
  3. Site Address: pick your site. Method: GET.
  4. Paste this into Uri:
_api/web/lists/getbytitle('SPGDemo Project Tasks')/views?$select=Title,Id,DefaultView,ServerRelativeUrl&$filter=Hidden eq false

Under Advanced parameters, turn on Headers and add this key and value (nometadata keeps the JSON short, without the old d/results wrapper):

{
  "Accept": "application/json;odata=nometadata"
}
Add an action pane in Power Automate with Send an HTTP request to SharePoint found by search

The $filter skips hidden system views, and $select returns only four properties. Our Power Automate OData filter query guide explains the filter syntax if you want other conditions.

Step 3: Turn the Views Into a Clean List With Select

The raw response is hard to read, so a Select action (Data Operation) keeps just the name, ID and default flag.

  1. Add Select and rename it Select view names.
  2. In From, use this expression:
body('Get_all_views')?['value']

Then switch Map to key/value mode and add three rows, with the expression on the right:

View     item()?['Title']
Id       item()?['Id']
Default  item()?['DefaultView']

Checkpoint: after a run, this action’s output lists all five views. You’ll see it in the test section below.

Step 4: Get One View by Its Title

Now we look up the single view the user typed.

  1. Add another Send an HTTP request to SharePoint and rename it Get view by title.
  2. Pick the same site and GET, and add the same Accept header.
  3. In Uri, type the text below, and insert the View name token from dynamic content between the quotes:
_api/web/lists/getbytitle('SPGDemo Project Tasks')/views/getbytitle('@{triggerBody()?['text']}')?$select=Title,Id,DefaultView,ServerRelativeUrl
Get view by title action with GET method and a Uri that uses the View name trigger input inside getbytitle

When you paste it, the designer shows @{triggerBody()?['text']} as the purple View name token. That’s normal.

Checkpoint: the action has three filled fields and one header, and the View name token sits inside getbytitle(‘…’).

Step 5: Catch a Missing View With Run After

If someone types a view that doesn’t exist, Get view by title fails. We add a branch that runs only then.

  1. Select + below Get view by title and add a Compose action named View not found.
  2. In Inputs, type the message below (View name is the trigger token).
  3. Open Settings > Run after, expand Get view by title, check Has failed and clear Is successful.
Could not find a view named @{triggerBody()?['text']}.
Run after settings for the View not found Compose action with only Has failed checked for Get view by title

The dashed red arrow on the canvas means “runs on failure”. Our post on try catch error handling in Power Automate takes this pattern further with scopes.

Step 6: Skip the Default View With a Condition

SharePoint keeps a list’s default view, and I don’t want the flow even trying to delete it.

  1. Add a Condition on the success path of Get view by title. Name it Condition not default view.
  2. Left value: the expression below. Operator: is equal to. Right value: the expression false.
  3. In the False branch, add a Compose with the message below.
body('Get_view_by_title')?['DefaultView']   is equal to   false
@{body('Get_view_by_title')?['Title']} is the default view, so the flow did not delete it.
Power Automate condition that checks whether DefaultView from Get view by title is equal to false

Type false as an expression, not as plain text, or the comparison never matches. More patterns live in our Power Automate multiple conditions guide.

Step 7: Delete the View by Its GUID

The last action goes in the True branch.

  1. Add Send an HTTP request to SharePoint and rename it Delete view.
  2. Same site. Method: DELETE.
  3. Paste this Uri, then add the same Accept header:
_api/web/lists/getbytitle('SPGDemo Project Tasks')/views(guid'@{body('Get_view_by_title')?['Id']}')
Delete view action with the DELETE method and a Uri that points to the view by its GUID

I use the GUID instead of the title here because a GUID never changes, even if someone renames the view between the two calls. The older version of this post used a POST to /deleteObject inside an Apply to each loop; one DELETE call is shorter and it’s what I tested.

Checkpoint: the True branch holds Delete view, the False branch holds the default-view message, and you can select Save.

Test the Flow

Select Test > Manually > Test, type a view name and select Run flow. I ran it three times.

Run flow panel in Power Automate with Due in 30 Days typed into the View name input

Run 1 – “Due in 30 Days”: succeeded. The Select action returned all five views with their IDs, and only All Items had Default set to true:

Select view names output listing five SharePoint list views with their IDs and Default flags
{
  "body": [
    { "View": "All Items", "Id": "fbf0b2fa-6130-483e-82b9-70a270f2cdd3", "Default": true },
    { "View": "Open Tasks", "Id": "1ced63ee-f69e-4e23-8f72-75c9da483c83", "Default": false },
    { "View": "High Priority", "Id": "5079fd2f-de9f-454d-9492-8a14c452a835", "Default": false },
    { "View": "Tasks by Department", "Id": "b2939cf0-772b-4f1d-91ff-a6d659750dc1", "Default": false },
    { "View": "Due in 30 Days", "Id": "c11760e2-cf53-4f80-bf5c-6a3d555f0026", "Default": false }
  ]
}

Delete view finished in 0.3 seconds, and Due in 30 Days disappeared from the view menu in SharePoint.

Flow run where Get view by title succeeded and the Delete view action ran in the True branch

Run 2 – “All Items”: succeeded in 758 ms and took the False branch, so the default view stayed. Run 3 – “Weekly Report” (a view that doesn’t exist): View not found ran, but the run still shows Failed.

Power Automate run history with two succeeded runs and one failed run of the get and delete list view flow

What a Missing View Returns (400, Not 404)

You might expect a 404 for a view that doesn’t exist. My run didn’t return one. Get view by title failed with 400 BadRequest and this body:

{
  "odata.error": {
    "code": "-2147024809, System.ArgumentException",
    "message": {
      "value": "The specified view is invalid."
    }
  }
}
Get view by title action failed with 400 BadRequest and the message The specified view is invalid

So don’t branch on status code 404. Use Run after (Step 5), or check that the message contains The specified view is invalid.

Note: handling the failure doesn’t turn the run green. If you want Run 3 to show Succeeded, end the View not found branch with a Terminate action set to Succeeded.

How to Delete a View in SharePoint Without a Flow

For a one-off cleanup, the SharePoint list itself is faster. Microsoft’s steps for the modern experience:

  1. Open the list and select View options on the command bar (the view switcher at the top right).
  2. Switch to the view you want to remove, then open View options again.
  3. Select Edit current view.
  4. Select Delete at the top or bottom of the Edit View page, then OK.

If Delete doesn’t show up, it’s the default view. Set another view as the default first. Our SharePoint list view guide walks through creating, changing and deleting views with screenshots.

Make It Production-Ready

  • Run it as a service account with Edit rights on only the lists it should clean.
  • Add an approval before Delete view if other people will trigger it.
  • Log what you delete: write the view Title and Id to a SharePoint log list before the DELETE call, so you can rebuild it later.
  • Loop over the Select output with Apply to each if you need to remove several views by a naming rule.

Troubleshooting

  • 400 BadRequest, “The specified view is invalid.” The title doesn’t match. Check spelling and spaces against the Select output.
  • Expression errors on body(‘Get_all_views’). Your action has a different name. Expressions use the action name with underscores instead of spaces.
  • The response has d and results. You used the verbose Accept header. Switch to application/json;odata=nometadata and read [‘value’].
  • The condition always goes to False. You typed false as text. Enter it as an expression.

Important: test with a view you can recreate. The flow can’t bring a deleted view back.

Where to Take It Next

If you’re working with SharePoint REST calls in flows, these posts are worth a look next:

Frequently Asked Questions

How do I delete a view in SharePoint?

Open the list, select View options, switch to the view, select View options again and choose Edit current view. Then select Delete and OK. You need Edit permission or higher (Microsoft support: Delete a list view).

Why can’t I delete a SharePoint list view?

Usually it’s the default view, so Delete doesn’t appear. Set another view as the default, then delete the old one. It can also mean you don’t have Edit permission on the list.

How do I get all views of a SharePoint list in Power Automate?

Use Send an HTTP request to SharePoint with GET and _api/web/lists/getbytitle(‘List name’)/views. Add $filter=Hidden eq false to skip system views, and read the value array from the body.

What does Power Automate return when the view doesn’t exist?

In my test, getbytitle on a missing view returned 400 BadRequest with the message The specified view is invalid. It did not return 404.

Does deleting a list view delete the list items?

No. A view only stores which columns, filters and sorting to show. Deleting it leaves every item in the list.