web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to find OneNote No...
Power Apps
Unanswered

How to find OneNote Notebook key

(0) ShareShare
ReportReport
Posted on by

I'm new to PowerApps and I'm trying to create a simple app that allows me to query information from my OneNote notebook. User enters a string, I look for pages that match that contain that string and list those pages to the user. 

 

Is this possible?

 

I've read the documentation of the OneNote connector for PowerApps and can't make heads or tails of it. 

If I wanted to use a function such as GetPageContent, where would I find the values for its parameters? Where do I find the values for notebookKey, sectionID, and pageID. 

 

Any help here would be much appreciated. 

 

Thanks

Categories:
I have the same question (0)
  • v-monli-msft Profile Picture
    on at

    Hi @Anonymous,

     

    To get the notebookKey, insert a dropdown control and set its Items property to:

     

    'OneNote(Business)'.GetNotebooks()

     

    Then getting the sectionId, by inserting the 2nd dropdown control, and set its Items property to:

     

    'OneNote(Business)'.GetSectionsInNotebook(Dropdown1.Selected.Key).value

     

    Add the 3nd dropdown control to get the pageId, set its Items property to:

     

    'OneNote(Business)'.GetPagesInSection(Dropdown1.Selected.Key,Dropdown2.Selected.pagesUrl).value

     

    Notice for Dropdown2 and Dropdown3, you could change the Value property to more user-friendly value by selecting on the right side panel:

    Capture.PNG

     

    Regards,

    Mona

  • Community Power Platform Member Profile Picture
    on at

    Thank you very much @v-monli-msft. This helps alot. Kind of a dumb follow up question, but how can I copy the values from the dropdown boxes so that I can use them elsewhere in the application?

  • v-monli-msft Profile Picture
    on at

    Hi @Anonymous,

     

    That depends. But mostly for dropdown controls, the formula should be something like:

    Dropdown1.Selected.xxx

    Smiley Happy

     

    Regards,

    Mona

  • Kurry Profile Picture
    69 on at

    Thanks for this guide, but to be able to retrieve the page content, I use the folowing code:

     

    Dropdown2.items:

    'OneNote(Business)'.GetNotebooks()

     

    Dropdown3.items:

    'OneNote(Business)'.GetSectionsInNotebook(Dropdown2.Selected.Key).value

     

    dropdown4.items:

    'OneNote(Business)'.GetPagesInSection(Dropdown2.Selected.Key,Dropdown3.Selected.pagesUrl).value

     

    On a RichTextEditor2.default I set this:

    'OneNote(Business)'.GetPageContent(Dropdown2.Selected.Key,Dropdown3.Selected.id,Dropdown3.Selected.id)

     

    The error I get is:

     

    {
     "duration": 48.9,
     "size": 307,
     "status": 400,
     "headers": {
     "Content-Length": 307,
     "Content-Type": "application/json",
     "x-ms-client-request-id": "ae21e304-aec3-49b6-b363-1055a51043bb"
     },
     "body": {
     "error": {
     "code": 400,
     "message": "The section id is invalid. If a custom value was entered, please try selecting from the supplied values.",
     "source": "europe-002.azure-apim.net",
     "path": "choose[3]\\when[1]",
     "clientRequestId": "ae21e304-aec3-49b6-b363-1055a51043bb"
     }
     }
    }

     

    I can use the section id for the retrieval of the page id's, so I guess the key should be ok?

    What am I doing wrong?

     

    Any help would be appreciated.

  • Ammanas7077 Profile Picture
    19 on at

    Anyone has any solution to displaying page content in a html window?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard