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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / When New SharePoint It...
Power Automate
Answered

When New SharePoint Item is Created > Create Folder > Convert Item Details to PDF > Add to folder

(0) ShareShare
ReportReport
Posted on by 16
Hi all!
 
I have a three-parter. I have built a SharePoint List with a custom form in Power Apps that includes approximately 55 fields. Here is what I am trying to accomplish (please forgive me, I am relatively new to this level of Automate):
  1. When a new item is created in this list, create a new folder in a designated SharePoint Document Library and name it the list item's Title + ID << I have done this! It is working just fine. Yay!
  2. Convert the new list item details from step 1 to a clean and formatted PDF (I am not looking to export the data as a table, but instead something similar to a completed PDF form)
  3. Save the new PDF from step 2 into the new folder created in step 1
I have read that the best way to accomplish part 2 of this (creating a PDF of the data) is to convert it first to HTML and then save a temporary html file in OneDrive, which can then be converted to PDF. I gave that a try and it is not going well... I have used the "Select" data operation and mapped out all of my columns, then used the "Create HTML table" data operation and threw the Select Body in there, and then used the OneDrive for Business "Create File" to choose the folder and name the file. When I run the flow, it does create a temporary HTML file to a One Drive folder, but it smooshes all the columns together and it includes all items in the list and not just the new item like I want. I am not sure how to limit it to the new item, format it, or how to get that temporary html file converted to a pdf and then saved back into the SharePoint folder.
 
Below are some screenshots to show what I have done so far. I would be greatly appreciative of any assistance! And remember, I am a relative novice here, so I beg you to explain any steps to me like I am a two year old. 
 
THANK YOU SO MUCH
 
Step 1: When a new item is created:
 
Step 2: Create new folder:
 
Step 3: Get items:
 
Step 4: Select
 
Step 5: Create HTML table:
 
Step 6: Create file:
 
 
Result:
 
I have the same question (0)
  • Verified answer
    PowerDeveloperTP Profile Picture
    453 on at
    Hello,
     
    One thing I observed is you are using get items action, are you limiting it using ID? I think you dont need to use get item action, as the trigger "New item created" itself will have all the details of new item.
     
    I think below blog explains what you are trying to do. Hope it helps.
     
    Thank you.
    Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
    This helps others find solutions to future issues!
  • EH-19031246-0 Profile Picture
    16 on at
    Thank you @PowerDeveloperTP! I took your suggestion to remove the Get Items and then followed the instructions in the provided video. When working on "Compose", it started adding a bunch more "For each" loops that I am not familiar with (5 of them now). I think it may have something to do with the fact that my fields contain multi-select combo boxes? Each time I added one of those to my "Compose" data operation it seemed to throw another on there. Anyhoo, when I tried save it said I needed to add parameters to the "for each"es, and I didn't know what to select. I clicked randomly (wrong choice) and saved, tested my flow, and it failed. 
     
    Any idea what I should select here?
     
     
    "For each 1":
     
    "For each":
     
    "For each 3":
     
     
    "For each 2":
     
     
    "For each 4":
     
     
    "For each 5":
     
     
  • Suggested answer
    PowerDeveloperTP Profile Picture
    453 on at
    Hello,
     
    Thank you for sharing details.
     
    Yes, Good catch, if you have multiselect columns then it would create loops. But, when you create html or pdf, we need those information in single field. So, you can append the multiselect values in a variable and pass it to html. I have created a sample for you and its working.
     
     
    Also, if you want table with borders and colours, you will have modify the code with CSS styles. This is my compose action
     
    <table style="border-collapse: collapse; width: 100%;">
        <tr>
            <th colspan="2" style="text-align: center; font-size: 16px; border: 1px solid black;background-color: #b6e3f2;height: 50px;">TEST TABLE</th>
        </tr>
        <tr>
            <td style="border: 1px solid black;padding: 10px;"><strong>Requested by</strong></td>
            <td style="border: 1px solid black;padding: 10px;">@{triggerBody()?['Author/DisplayName']}</td>
        </tr>
    <tr>
            <td style="border: 1px solid black;padding: 10px;"><strong>Title</strong></td>
            <td style="border: 1px solid black;padding: 10px;">@{triggerBody()?['Title']}</td>
        </tr>
    <tr>
            <td style="border: 1px solid black;padding: 10px;"><strong>Multiselect</strong></td>
            <td style="border: 1px solid black;padding: 10px;">@{variables('Mutiselect')}</td>
        </tr>   
    </table>
     
     
    Hope this helps.
     
    Thank you.
    Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
    This helps others find solutions to future issues!
  • EH-19031246-0 Profile Picture
    16 on at
    Thank you so much @PowerDeveloperTP for leading me down the right path! I was able to use this information as a starting point and got all 3 steps to work correctly! Thank you so much for your help!

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard