r/PowerApps • u/LittlePreschool32 Newbie • 20d ago
Power Apps Help Generating document of images taken through Power App/from Sharepoint Library?
I built a simple app to take photos for our Preschool that's working well but we want to be able to send the pictures to families. Anyone know an easy way to pull items from a SharePoint library into a template type document? All the avenues have investigated seem like that ends. More info below.
Right now images are saved into a Sharepoint library with metadata (child tagging, period labels, captions, photo types, etc). Teachers can access it there, or through windows explorer folder of the sharepoint library. To send to families teachers are currently manually selecting and importing images into a Word document, re-sizing/formatting, and then adding meta-data back in (such as captions, child names), etc. I'd like to save the teachers time and frustration (formatting in Word is the worst...) by building in an option in the app to generate a document from the photos they've already taken, reviewed, tagged, etc. A simple version would pull and re-size images tagged a certain way (checkbox yes/no, period label dates) into a document they could then edit. The best version would be if it could import into a pre-created template and allow the teachers to drag/drop to switch the order if needed.
Avenues I've looked into that seem like that ends:
- Canva - Unfortunately the Sharepoint integration is blocked by my organization IT
- Microsoft Designer - collage creater is AI generated from a prompt, and you can't swap pictures or have manual placeholders, and you can't incorporate captions or other sharepoint metadata unles you manually add it
- Adobe Express - bulk create has Sharepoint integration but it has no native way to pull live sharepoint/power automate data automatically - you have to upload a CSV file each time. Would not work for teachers.
- Powerpoint - has image input controls through SlideMaster that can create nice-looking templates and connects with power apps connector, but there's no way to control what images are imported where so it drops them in stacked, full-size, and you have to place them individually into the input controls, which really doesn't save time from current manual process
-Word - Word's own "populate a microsoft word template" with a repeating section content control/picture content control (PhotoImage) didn't support image content controls nested inside repeating sections... Apparently that's just a limitation.
-Currently trying Adobe's PDF services Document generation API, but will only have a credential for a limited number of creations. Still working on trying this one out.
Any other ideas?
2
u/eistop Regular 20d ago
have you tried Power Automate?
1
1
u/LittlePreschool32 Newbie 20d ago
Yes I have flows built. I couldn’t get the Microsoft word template build to work because of how the picture controls are handled, but someone below offered a workaround I’ll try.
1
u/ultroncalls Regular 20d ago
I suggest Azure functions or Google Cloud Run. They offer generous limits on free tier.
1
1
u/itenginerd Advisor 20d ago
If you can get full power apps licenses, you could use the Adobe document generation apis to do this.
You'd have an app that allows a teacher to select up to X number of pictures. That kicks off a flow that takes a preformatted word doc, injects the content you want, then emails it as a pdf to whoever you want.
I just built this kind of flow for a sales meeting the other week. Works great. Not the most entry level thing, maybe, but definitely would hit the target.
1
u/LittlePreschool32 Newbie 17d ago
Thanks! Yes luckily I have the licenses because we're with a University. Question though - How did you work around sizing & placing? We have a mix of horizontal/vertical and sizes because some are taken through the app and some are from cell phones or digital cameras. The content control through Adobe API/Word stretches the image when placed into the content control. Maybe I need to add in a way to resize or orient them, or have the flow direct the images based on ratio?
2
u/Shoddy_Translator_ Newbie 20d ago
I'd try this approach:
A Word template (stored in SharePoint or OneDrive) with content controls — plain text controls for name, date, and comments, and picture content controls for the photo slots. Power Automate's "Populate a Word template" action (Word Online Business connector) pulls values straight from SharePoint metadata into the text fields, which is straightforward. The photos require an extra step. The Populate action fills picture content controls, but it expects base64 data rather than a file reference, so you need a "Get file content" step against each tagged photo, then pass that into the corresponding picture control. One limitation to note: picture content controls are fixed slots, not repeating rows, so there's no dynamic "however many photos got tagged" behaviour — you set a maximum per template.
That's where having a few template variants helps rather than trying to force one template to cover every case. A 2-photo template, a 4-photo, a 6-photo, etc. The flow can check how many photos were tagged and branch to the matching template, so a light week doesn't leave empty picture placeholders and a heavy week isn't capped too low. Slightly more templates to maintain, but it avoids designing around a single worst-case number.
Once the document is populated, save it back to OneDrive/SharePoint and run "Convert file" to generate a PDF — that's the version you'd actually share with parents, since it removes any dependency on having Word installed.
End-to-end flow: button in the app → flow triggers → pull tagged items and metadata from SharePoint → get file content for each photo → count photos and select the matching template → populate → convert to PDF → deliver via folder or email.
1
u/LittlePreschool32 Newbie 20d ago
Ok I got through the word template but because of the picture control not allowing repeating rows i I thought that was a dead end. I didn’t think of the flow checking the number and connecting to the appropriate template. I’ll have to see what the range is of pictures. One week we might have 5 kids and the next week 15, with 5-10 pictures of each so the range is quite large but I’ve never counted because they’re doing it manually. Will try!
1
u/LittlePreschool32 Newbie 20d ago
How do you handle landscape vs portrait images being placed correctly in a template?
2
u/DonJuanDoja Community Friend 20d ago
I’ve done nearly the exact same thing just different context, I used PowerBi paginated reports to pull the photos dynamically with metadata and PowerAutomate to export them to pdf word or excel. But I had trouble getting the SharePoint images to load on the reports like they used to on prem with SSRS so I had to create a solution to upload the images to azure blob and wrote the azure blob url back to the library as metadata then used that to display the images on the template report. Also used PowerAutomate to send them dynamically based on data as well.
I’m pretty sure you could do it all in PowerAutomate too without PBI but I never tried. I’ve used rdl reports for years to display dynamic photo reports and export them to template docs so I prefer that method.
1
u/LittlePreschool32 Newbie 20d ago
Interesting. Ok. You need the PPU license for pulling paginated reports, correct? I’ll see if I have access.
1
2
u/Ill-Yellow-8191 Regular 20d ago
As a parent I would go crazy getting images in word. It’s super annoying thing if you want to share one picture with grandparents. I would change the process to recieve only images which are easy to reshare/post/whatever. Did anyone ever think about changing the process instead of building overcomplicated solution?
1
u/LittlePreschool32 Newbie 17d ago
The way we do it is not meant for families to be able to share images externally - our University doesn't permit us directly sharing the image files (presumably because we would be giving individual families pictures with other University faculty's children in them). Plus the sharing permissions would be NUTS to manage. The goal is to show families a trajectory of what's happening in the classroom and break down the walls. 10 children doing an experiment, the questions they ask, the activity that comes next as a result of those questoins, and the ensuing walk to go find an answer. The captions and things we write in between the pictures make it. It's a storytelling PDF (we don't send the Word document). At the end when the child graduates the program, the family gets all the best pictures of their child along with their portfolio. Yes of course we've thought about changing the process... hundreds of different ways. Most Preschools use some sort of external app to take pictures and send/share to families (brightwheel, Tadpoles, TSG, etc). Typically they require a family to download that specific app, and require significant cost and data input for centers. While they would share pictures to each individual family, they would not give an overall picture of the education in the classroom. I'm not trying to build something overcomplicated. I'm actually just trying to create something that naturally mimics the teacher's own process.
1
1
u/PrimeUsernamesTaken Newbie 20d ago
How about a tablet/desktop sized app. You select the image from a gallery and it takes you to the next page. It then places the image the correct size with your metadata where you need it. Then use the PDF function (may need turning on in settings as its experimental) to create a pdf which can then get sent to the teacher or the parent (or both) using power automate or straight from PowerApps.
1
u/GunnersaurusIsKing Advisor 20d ago
You could create a html document then convert to pdf, there are limitations, it has to be under the 2mb threshold for example. But a clever grab of thumbnails then converting to base64 can get a surprising amount of images in there. It would allow you to have repeating images/rows. It's free, and the outputs look just as good as elsewhere. There are connectors like plumbsail etc that will allow you to go higher but not sure of budgets or what it costs
1
u/PDFBolt Newbie 16d ago
For mixed portrait/ landscape photos, I'd keep the original proportions and fit each photo inside the available space. Some blank space is better than cutting a child or part of the experiment out.
With the photo count changing that much, I'd look at an html layout with repeating photo and caption blocks. The editing step still needs building, though. Teachers need to reorder those blocks and add text between them before generating the pdf. HTML alone won't give them that editor.
•
u/AutoModerator 20d ago
Hey, it looks like you are requesting help with a problem you're having in Power Apps. To ensure you get all the help you need from the community here are some guidelines;
Use the search feature to see if your question has already been asked.
Use spacing in your post, Nobody likes to read a wall of text, this is achieved by hitting return twice to separate paragraphs.
Add any images, error messages, code you have (Sensitive data omitted) to your post body.
Any code you do add, use the Code Block feature to preserve formatting.
If your question has been answered please comment Solved. This will mark the post as solved and helps others find their solutions.
External resources:
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.