Forum Discussion

CardinalNight's avatar
CardinalNight
Brass Contributor
Oct 04, 2023

How to retrieve all hubsites and associated sites using SPFx and sp/PnP

I have the below code and this retrieves what I believe is all the hubsites in my tenant: export const GetHubSites = async () => { const _sp = getSP(); const finalArray: any[] = []; const hub...
  • ganeshsanap's avatar
    ganeshsanap
    Oct 05, 2023

    CardinalNight You have to pass the parent hub site ID to DepartmentId property to fetch the associated SharePoint sites with that particular hub site. 

     

    Check the links given in my above response once.


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Resources