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

Community site session details

Session Id : 7H1AVgS/jR6lOpB41JL/Xi
Power Automate - Building Flows
Unanswered

Export sections as PDF from Notebook on the 1st every month

Like (2) ShareShare
ReportReport
Posted on 1 Apr 2023 15:47:12 by 34

Hi,

 

since a few weeks our department uses OneNote as a shift handover tool. We have a Night, Morning and Afternoon shift.

The group section is the current year, the group section is divided into sections (called months). Each section consist of pages. These pages are used as shift handover.

 

How the pages are built up:

2023 >> April

1-4-2023 Night Shift

1-4-2023 Morning Shift

1-4-2023 Afternoon Shift

2-4-2023 Night Shift

2-4-2023 Morning Shift

2-4-2023 Afternoon Shift

 

I would like to create a PDF back-up on the 1st of May at 01:00AM of all the pages (all the shift reports) in the previous section (April).

On 1st of June at 01:00AM a PDF backup of all the pages (all the shift reports) for May etc etc.

 

Programming such a flow requires a lot of know how and unfortunately i only have minor basic knowledge of Flows.

 

Thank you very much for helping out!

  • PBNZ_PPcommunity Profile Picture
    3 on 07 Feb 2025 at 01:03:57
    Export sections as PDF from Notebook on the 1st every month
    Hi,
     
    Did you ever manage to finish this Flow to successfully export/save OneNote content to PDF? If so, I was wondering if you'd mind to please share it here? Would love to replicate your approach.
     
    Thanks very much in advance!
     
    Cheers,
    Peter
  • v-jefferni Profile Picture
    on 13 Apr 2023 at 02:19:52
    Re: Export sections as PDF from Notebook on the 1st every month

    Hi @Vieri ,

     

    If you have any issue you can leave in this thread and I will help you out. Sorry but I cannot save Non-certified programs in my hardware.

     

    Best regards,

  • Vieri Profile Picture
    34 on 12 Apr 2023 at 02:04:53
    Re: Export sections as PDF from Notebook on the 1st every month

    Hi @v-jefferni 

     

    Thank you very much for your effort to help me out. I just spend 1,5 night shifts trying to find out where the mistake could be in my Flow.

     

    Is it possible to share my flow with you? You have put so much effort in creating this flow that it would be a pity if i can't manage to get it working.

     

    Thank you!

  • v-jefferni Profile Picture
    on 07 Apr 2023 at 10:10:36
    Re: Export sections as PDF from Notebook on the 1st every month

    Hi @Vieri ,

     

    I find a mistake:

    vjefferni_0-1680861299613.png

     

    The logic is simple, except for getting page contents into the array variable.

    vjefferni_1-1680862053386.png

    vjefferni_2-1680862128798.png

    Next is use the entire array as file content to create the HTML file, since page contents are with HTML codes.

     

    Best regards,

  • Vieri Profile Picture
    34 on 07 Apr 2023 at 09:45:37
    Re: Export sections as PDF from Notebook on the 1st every month

    Hi,

     

    flow has been finished but unfortunately no file is appearing. Please find below my steps with details about the dynamic content. I surely made a mistake as i am having difficulties to understand the various actions 😥 I have left out the notebook key due to privacy reasons

     

    1.jpg2.jpg3.jpg4.jpg5.jpg

  • v-jefferni Profile Picture
    on 07 Apr 2023 at 08:10:35
    Re: Export sections as PDF from Notebook on the 1st every month

    Hi @Vieri ,

     

    They are both in Filter array 2, so just select dynamic contents from Filter array 2:

    vjefferni_0-1680854846886.png

     

    pageContents is name of the variable, so it's inserting the entire array variable as file content. You can use SharePoint create file action to replace the Create file 2 action in my flow.

     

    Best regards,

  • Vieri Profile Picture
    34 on 07 Apr 2023 at 07:56:27
    Re: Export sections as PDF from Notebook on the 1st every month

    Hi, thank you for your swift response. This helped a lot since it succeeded a test so far without creating a file. Now i am stuck at the 'create file' section.

     

    I can choose 'SectionName' from [Filter Array 2], [Parse JSON] or [Filter Array] but with last 2 options a 3rd Apply to each is created which i do not see in your example. 

     

    [Filter Array 2] does not create a 3rd apply to each, but for File Content i do not see 'pageContents' from [Append to Array Variable) available.

     

    Clearly i am doing something wrong. Besides, i would like to create the file on Sharepoint so is an alternative available with Create Sharepoint File?

  • v-jefferni Profile Picture
    on 07 Apr 2023 at 06:58:09
    Re: Export sections as PDF from Notebook on the 1st every month

    Hi @Vieri ,

     

    I wrote the expression in Select:

    vjefferni_0-1680850419787.png

    item()?['parentSectionGroup/name']

     

    The dynamic content in Apply to each 2 is:

    vjefferni_1-1680850630575.png

     

    Or you can easily write expression:

    items('Apply_to_each_2')?['id']

     

    Best regards,

  • Vieri Profile Picture
    34 on 07 Apr 2023 at 06:44:33
    Re: Export sections as PDF from Notebook on the 1st every month

    Wow, thank you very much for this flow. Currently i am creating the flow but i run into some challenges. Your images are very helpful but i would like to ask if it is possible to have some items a bit clarified.

     

    1.For the [Select] i do not have a 'parentsection' available. I have choosen Section Identifier from the available options. 

    Filter Array.jpg

     

    2. For [Apply to each 2] i do not know which dynamic content is specified in your example

    Apply to each 2.jpg

     

    Thank you

  • v-jefferni Profile Picture
    on 03 Apr 2023 at 07:04:43
    Re: Export sections as PDF from Notebook on the 1st every month

    Hi @Vieri ,

     

    I have created some OneNote Sections/Pages for test:

    vjefferni_1-1680504222177.png

     

    Flow overview:

    vjefferni_0-1680504202899.png

    vjefferni_9-1680505364414.png

     

    Flow details:

    vjefferni_5-1680505074753.png

    vjefferni_6-1680505137257.png

    vjefferni_7-1680505248335.png

    vjefferni_8-1680505277356.png

     

    JSON Schema:

    {
     "type": "array",
     "items": {
     "type": "object",
     "properties": {
     "SectionGroup": {
     "type": "string"
     },
     "SectionKey": {
     "type": "string"
     },
     "SectionName": {
     "type": "string"
     }
     },
     "required": [
     "SectionGroup",
     "SectionKey",
     "SectionName"
     ]
     }
    }

     

    Best regards,

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete