How to add SharePoint list into navigation with Power Automate
Posted On July 14, 2021
“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.
Accept : application/json;odata=verbose
Content-Type : application/json;odata=verbose
"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 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:
To which you can then add the new property “addNavLink”: true.
Such request will create a copy of an existing list and add it automatically to the site navigation.
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.