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

%3CLINGO-SUB%20id%3D%22lingo-sub-1387456%22%20slang%3D%22en-US%22%3EImport%20from%20a%20csv%2Fexcel%20to%20create%20a%20hub%20site%20navigation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1387456%22%20slang%3D%22en-US%22%3E%3CP%3EHello!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20scenario%20where%20we've%20created%20a%20SPO%20site%20called%20'clients'%20and%20registered%20it%20as%20a%20hub.%26nbsp%3B%20There%20are%20several%20dozen%20individual%20client%20sites%20that%20will%20be%20associated%20to%20this%20hub.%26nbsp%3B%20I%20don't%20want%20to%20manually%20add%20all%20of%20these%20links.%26nbsp%3B%20Is%20there%20a%20script%20that%20I%20could%20use%20to%20import%20the%20navigation%20items%20from%20a%20csv%2Fspreadsheet%20to%20build%20out%20the%20navigation%3F%26nbsp%3B%20The%20navigation%20should%20look%20something%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EClients%20(the%20default%20navigation%20link)%3C%2FLI%3E%3CLI%3EIntranet%20Home%3C%2FLI%3E%3CLI%3EStuff%201%3C%2FLI%3E%3CLI%3EStuff%202%3C%2FLI%3E%3CLI%3EClients%20(i%20know%20it's%20redundant%20because%20i%20don't%20see%20anyway%20to%20add%20the%20following%20layers%20to%20the%20hub%20navigation%20otherwise)%3CUL%3E%3CLI%3EA%20(Heading)%3CUL%3E%3CLI%3EArnold%20(associated%20site)%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3CLI%3EB%20(Heading)%3CUL%3E%3CLI%3EBetty%20(associated%20site)%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1387456%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
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.