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 Automate / Export sections as PDF...
Power Automate
Unanswered

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

(2) ShareShare
ReportReport
Posted on 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!

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

    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,

  • Vieri Profile Picture
    34 on at

    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 at

    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 at

    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 at

    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 at

    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 at

    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 at

    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 at

    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,

  • PBNZ_PPcommunity Profile Picture
    3 on at
    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

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard