0

I notice that in One Note Web, you cannot nest a section group within a section group like this:

Sports (Section Group)
    Basketball (Section Group)
        Teams (Section Group)
            Toronto Raptors (Section)
                Raptors update1 (page)
                Raptors update2 (page)
            Los Angeles Lakers (Section)
                Lakers update1 (page)
                Lakers update2 (page)
    Hockey (Section Group)
        Teams (Section Group)
            Vancouver Canucks (Section)
                Canucks update1 (page)
            Calgary Flames (Section)
                Flames update1 (page)

But it is possible to do so with OneNote 2016 and OneNote Desktop that comes with Windows 10.

I am trying to extract children section group from a parent section group with the OneNote Js API, does that mean that it is not possible since it is not supported from the front-end?

Thanks.

Ben Wong
  • 691
  • 2
  • 19
  • 29

1 Answers1

0
var companiesSectionGroups = sectionGroups.getByName("Companies");

companiesSectionGroups.load("sectionGroups");
var sectionGroup;
var nestedSectionGroup;

return context.sync()
  .then(function () {

    nestedSectionGroup = companiesSectionGroups.items[0];
    nestedSectionGroup.load("sectionGroups");
    return context.sync()
  }).then(function () {
    console.log(nestedSectionGroup);
    nestedSectionGroup.sectionGroups.items.forEach(function (i) {
      console.log(i.name);
              return context.sync();

    })
    return context.sync();
  })

I got it. It's this. You have to load the first sectiongroup, then load the nested section group, then you can access it. Thanks.

Ben Wong
  • 691
  • 2
  • 19
  • 29