Import from a csv/excel to create a hub site navigation

Iron Contributor

Hello!

 

I have scenario where we've created a SPO site called 'clients' and registered it as a hub.  There are several dozen individual client sites that will be associated to this hub.  I don't want to manually add all of these links.  Is there a script that I could use to import the navigation items from a csv/spreadsheet to build out the navigation?  The navigation should look something like this:

 

  • Clients (the default navigation link)
  • Intranet Home
  • Stuff 1
  • Stuff 2
  • Clients (i know it's redundant because i don't see anyway to add the following layers to the hub navigation otherwise)
    • A (Heading)
      • Arnold (associated site)
    • B (Heading)
      • Betty (associated site)

 

2 Replies

@Scott Smith Did you ever find an answer to this? I have almost the same exact scenario.

 

EDIT: see if this helps:  Replicate SharePoint Hub site navigation to other Hub sites – James Callaghan (jcallaghan.com)

You'd have to see if you can parse out the import/copy-hub bit.  Hopefully you are more versed in Powershell than I am!  

 

I believe that I found a powershell script out there that basically let you import hub navigation from a CSV. But I'm not entirely certain of that now. Because I had a bigger issue that was not listed in my original post. Basically I had the Clients header but also a 'prospects' header that had the same secondary letter heading. It was strange but it kept erroring out, seemed to be getting confused that it already 'wrote client A' so it wouldn't write 'prospect A'. This became a naming convention thing that my customer settled on:

Client
A.
Prospect
A-

Anyway, I'll see if I still have the original script but honestly I think I might have ended up just rolling up my sleeves and creating it all manually.

Then my next issue was to do that for all the other hub navigations (four or five -- this was pre-SharePoint App bar with Global Navigation).  But I did end up finding a process/script to copy one hub navigation to others programmatically.  The script would export the 'main' hub navigation to a CSV which would be manually updated.  Then the CSV could be imported and would replace all subsequent navigation for the other hubs.  It took a long time to run and even longer time to refresh in everyone's browser.  But now all of that this is redundant with the global nav available. 

I'm pretty sure that I do have that copy script somewhere in which case it might help you by extracting the import from CSV piece. Again, I'll try and dig up the original blog that I found detailing this or try and find my hacked script.