Remove a field from a View

How to remove a field from a SharePoint Online list view using a Power Automate flow.

URI

_api/web/lists/getbytitle('@{variables('ListName')}')/Views('@{variables('ViewId')}')/ViewFields/removeViewField

Headers

{
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose"
}

Body

{
"strField": "ExampleField"
}

Screenshot with example

removeviewfield

Copy/paste example

{"id":"c846ddb3-03ac-43ea-82c1-a0b85e88b82e","brandColor":"#036C70","connectionReferences":{"shared_sharepointonline":{"connection":{"id":"/exp_sharedsharepointonline_e5efa"}}},"connectorDisplayName":"SharePoint","icon":"https://connectoricons-prod.azureedge.net/releases/v1.0.1601/1.0.1601.3047/sharepointonline/icon.png","isTrigger":false,"operationName":"Send_an_HTTP_request_to_SharePoint","operationDefinition":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_sharepointonline","operationId":"HttpRequest","apiId":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline"},"parameters":{"dataset":"@parameters('SPOSiteCollection_PowerUsers (exp_SPOSiteCollection_PowerUsers)')","parameters/method":"POST","parameters/uri":"_api/web/lists/getbytitle('@{variables('ListName')}')/Views('@{variables('ViewId')}')/ViewFields/removeViewField","parameters/headers":{"Accept":"application/json;odata=verbose","Content-Type":"application/json;odata=verbose"},"parameters/body":"{\n\"strField\": \"ExampleField\"\n}"},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{"Initialize_variable_-_ViewId":["Succeeded"]},"metadata":{"operationMetadataId":"3343c481-9d15-4aae-aa15-189551f65f16"}}}

YouTube video with example

Resources

SP.ViewFieldCollection.remove Method

That’s it, Happy testing!

You may also like...

1 Response

  1. Ollie says:

    I get a bad gateway error when I use this method unfortunately.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.