How to add SharePoint list into navigation with Power Automate

“I use Power Automate for creation of new SharePoint list(s), but they’re not added to the navigation automatically. How can I add them in a flow?”


When you create new SharePoint lists using the SharePoint interface, you can add them also to the navigation. It’s just one checkbox to check during the list creation. But what if you’re creating lists automatically with a Power Automate flow? It doesn’t give you any checkbox, and it won’t automatically add the list to the navigation either. When using flow, you must implement the navigation adding functionality by yourself.

This post will show you two ways how to add SharePoint list to a navigation with Power Automate.

Send an HTTP request

The more universal solution is to use an HTTP request to SharePoint. With the HTTP request you can add any link to the navigation, you just define the link and the title. It’s not connected to the list creation, it’s a separate action which you can use whenever you need.

Method: POST

Uri:
_api/web/navigation/QuickLaunch

Headers:
Accept : application/json;odata=verbose
Content-Type : application/json;odata=verbose

Body:
{
    "__metadata": {
        "type": "SP.NavigationNode"
    },
    "Title": "<Name of the navigation link>",
    "Url": "<Full link>"
}

Add link during the list creation

The second solution is an extension to the creation of new SharePoint list from an existing one. As already explained in that post, you can use your browser console to follow the communication during the list creation. And if you do that, you’ll notice ‘addNavLink’ property in the ExecuteTemplateScript() method input.

Since you won’t get this property from the GetSiteScriptFromList() (even though the documentation mentions it), you must add it by yourself. Power Automate has an expression addProperty(…) exactly for that.

addProperty(…) expression

AddProperty(…) expression allows you to add new property to an existing object. In this situation the object is everything between the [ and ] – the first object in the “actions” array. Unlike the original post, you can’t take the whole ‘actions’ value. The whole ‘actions’ value is an array, but you need only the first object from the array:

body('Parse_JSON')?['actions'][0]

To which you can then add the new property “addNavLink”: true.

addProperty(body('Parse_JSON')?['actions'][0],'addNavLink',true)
Power Automate add SharePoint list navigation

Use the whole expression inside the replace(…) from the original post to convert it into format required by the GetSiteScriptFromList() method.

replace(replace(string(addProperty(body('Parse_JSON')?['actions'][0],'addNavLink',true)),'\','\\'),'"','\"')

Enclose it back by the opening [ and closing ], which you removed to add the new property, and add the remaining elements to use it in the HTTP request.

{"script": "{\"actions\":[@{replace(replace(string(addProperty(body('Parse_JSON')?['actions'][0],'addNavLink',true)),'\','\\'),'"','\"')}]}"}
Power Automate add SharePoint list navigation

Such request will create a copy of an existing list and add it automatically to the site navigation.

Summary

This post explained two options how to add new SharePoint list into navigation with Power Automate. The first option with the separate HTTP request is more universal one. You can add any link, you can define it’s name, and you can add it anytime.

The second option is connected to the creation of SharePoint lists from existing ones and has a few limitations. You can use it only during the creation of a list, and the title of the link will be the title of the list.

Therefore, if the navigation title should be 1:1 to the list title, you can use both. If it should be different then you must use the separate HTTP request.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

3 Comments

Add a Comment

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