Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Triggers
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Resources
  • Get help with flow
Menu

How to add SharePoint list into navigation with Power Automate

Posted on July 14, 2021July 14, 2021 by Tom

“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.

4 thoughts on “How to add SharePoint list into navigation with Power Automate”

  1. Glenn says:
    July 15, 2021 at 2:46 am

    You are an absolute legend for putting this up, thank you for this guide!

    I seriously thought I was doing something wrong and wasted a day debugging and working out if I did something wrong when the documentation example had shown it was part of the output.

    Thanks again!

    Reply
  2. Jessic says:
    August 5, 2021 at 1:27 am

    I’m getting a unique error when I try to add nav link during list creation:

    Unable to process template language expressions in action ‘create_list’ inputs at line ‘1’ and column ‘22537’: ‘The template language expression ‘replace(replace(string(addProperty(body(‘get_list_contents’)?[‘actions’][0], ‘addNavLink’, true)),’\’,’\\’),'”‘,’\”‘)’ cannot be evaluated because property ‘0’ cannot be selected. Please see https://aka.ms/logicexpressions for usage details.’.

    And the flow worked last week. Have I over looked something?

    Reply
    1. Tom says:
      August 6, 2021 at 4:36 pm

      Hello Jessic,
      I just tested the solution on my environment and didn’t encounter any issues. I’d check the ‘Parse JSON’ action (called probably ‘get_list_contents’ in your flow) in the run history if it contains the “actions” array. If it doesn’t there might be some problem with the previous http request (the one to get the list structure).

      Reply
  3. Deanna says:
    February 10, 2022 at 6:23 pm

    Thank you! Just added this to your “Create new SharePoint list from existing SP list with Power Automate” flow.

    Another incredibly useful post.

    Reply

Leave a Reply Cancel reply

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

Do you know what to do, but not how to do it?

Get The Ultimate Power Automate expressions cheat sheet and translate your thoughts into flows with ease!


NEW! Master the HTTP requests to SharePoint with a new cheat sheet!

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.

Hello and welcome!

My name is Tom and I'm a business process automation consultant and Microsoft MVP living in the Czech Republic. I’ve been working with Microsoft technologies for almost 10 years, currently using mainly Power Automate, SharePoint, Teams, and the other M365 tools.

I believe that everyone can automate part of their work with the Power Automate platform. You can achieve a lot by "clicking" the flows in the designer, but you can achieve much more if you add a bit of coding knowledge. And that's what this blog is about.

To make the step from no-code Power Automate flows to low-code flows: using basic coding knowledge to build more complex yet more efficient flows to automate more of your daily tasks.

  • Use Power Automate to forward Outlook events upon registrationJanuary 29, 2023
  • Why the condition is false for the same numbers (Power Automate)January 25, 2023
  • How to forward event invitation to other calendar (Power Automate)January 22, 2023
  • Run ‘For selected item’ flow from non-default environment (Power Automate)January 18, 2023
  • Hide button in SharePoint list after Power Automate flow startedJanuary 15, 2023

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes