cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NewNW
Advocate II
Advocate II

Create Sharepoint online top navigation item using REST API

Hi,

I have a Hub site, and using power automate, I m provision the SharePoint Team site and then associate the newly created Team site with the Hub site. 

Now I want to add the newly created site URL in the Hub site top navigation bar as an item. e.g - I have three portfolios, so three top navigation; when a new Team site gets created, I want to add the URL under a Portfolio based on the user request.

Can someone guide me to do this? 

 

Thanks.

2 REPLIES 2
Expiscornovus
Super User
Super User

Hi @NewNW,

 

You could use a POST request against the node id of Portfolio node.

 

Below is an example.

 

URI

_api/web/Navigation/GetNodeById(@{variables('NodeId')})/children

 

Headers

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

 

Body

{ 
"__metadata": 
{ "type": "SP.NavigationNode" },
"IsExternal": false, 
"Title": "Power Automate", 
 "Url": "@{variables('SiteUrl')}" 
 }

 

postchildnode_navigation.png



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


@Expiscornovus  Thank you very much I ll give it a go and get back to you.

 

Thanks.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (2,185)