Update List Colour

How to update the colour of a SharePoint Online list using a Power Automate flow.

URI

_api/web/lists/getbytitle('Admin Tasks')

Headers

{
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose",
"If-Match": "*",
"X-HTTP-Method": "MERGE"
}

Body

{
"__metadata": { "type": "SP.List" },
"Color": "8"
}

Screenshot with example

Sample data
List Title – Admin Tasks
Color – 8 (Blue purple) (range 0 – 11, 12 colours are available)

updatelistcolour

Expected response

HTTP statusCode 204

{
"statusCode":204,
"headers": {}
}

Copy/paste example

{"id":"f962e5e5-4672-4240-96b0-95bf15a74001","brandColor":"#036C70","connectionReferences":{"shared_sharepointonline":{"connection":{"id":"/exp_sharedsharepointonline_e5efa"}}},"connectorDisplayName":"SharePoint","icon":"https://connectoricons-prod.azureedge.net/releases/v1.0.1723/1.0.1723.3986/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('Admin Tasks')","parameters/headers":{"Accept":"application/json;odata=verbose","Content-Type":"application/json;odata=verbose","If-Match":"*","X-HTTP-Method":"MERGE"},"parameters/body":"{\n\"__metadata\": { \"type\": \"SP.List\" },\n\"Color\": \"8\"\n}"},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{},"metadata":{"operationMetadataId":"e042e6d7-4bb2-4131-b09b-a315a37cb163"}}}

Resources

Working with lists by using REST

That’s it, Happy testing!

You may also like...

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.