What's new in Power Platform? - Ep 1

What's new in Power Platform? - Ep 1

Welcome to the first Episode of What's new in Power Platform?

Before diving into the new feature, I'd like to introduce myself. I am Stuart Baxter, Power Platform Solution Architect at Kerv Digital. I've been working with Microsoft technologies for almost 8 years and have spent the last 4 working with Power Platform. I enjoy building creative solutions for our customers using the latest features.

In this episode we'll be looking at the new PDF function in Canvas Apps. This function allows you to generate a PDF from a control or screen, as a bonus tip I'll also show you how to send an email with the PDF attached using the Office 365 Outlook connector.


Before we dive into how to use the function, you should be aware that this is an experimental feature. Experimental features aren't meant for production use and may have restricted functionality.


Enabling the PDF function

Before use, you need to enable the function by clicking Settings in the command bar, then set the toggle to on.

screenshot of command bar with settings button highlighted
screenshot of the settings page with PDF function turned on

Basic Syntax

PDF(screen or control name)        

Optional Parameters

Size: the paper size of the PDF, e.g. A3

PDF(screen or control name,{size:A3})        

DPI: Controls the resolution of the PDF

PDF(screen or control name,{DPI: 100})        

Margin: the margins around the PDF, supported units of measurement are in, mm, cm, pt & px

PDF(screen or control name,{Margin: "25mm"})        

Orientation: Portrait or Landscape

PDF(screen or control name,{Orientation: "Landscape"})        

Expand Containers: controls whether or not containers that have overflowed the specified size should be expanded, supports vertical galleries, containers, screens, scrollable controls and forms

PDF(screen or control name,{ExpandContainers: true})        

Now that we've explored the optional parameters, lets catch a Pokémon!

The Pokédex App - Background

The Pokédex app is a fun project that I built for my son, who loves Pokémon! It displays a list of all Pokémon - taken from PokéAPI), he can then select from that list or search using a text box in the top right, and some details about the Pokémon are displayed.

Screenshot of Pokedex App

When I first gave it to him, he asked if he could "catch" the Pokémon by clicking on the Pokéball in the top left. At the time I hadn't quite figured out the best way to do this... until now!

The Solution

Using a combination of the PDF function and the Office 365 Outlook connector, I created a PDF of the screen and sent it to him by email using the below formula in the OnSelect property of the Pokéball:

With
? ?{wPokemon: PDF(Pokedex,{Size:A3, Orientation: "Landscape"})},
? ?Office365Outlook.SendEmailV2(
? ? ? User().Email,
? ? ? "You have captured a new Pokemon",
? ? ? "Congratulations on catching a " & lbl_pokemonname,
? ? ? {
? ? ? ? ?Attachments:?
? ? ? ? {
? ? ? ? ? ? Name: lbl_pokemonname&".pdf",
? ? ? ? ? ? ContentBytes: wPokemon
? ? ? ? }
? ? ?}
? )
)        

The Result

screenshot of an email with attached PDF

After clicking the Pokéball icon, an email is sent to congratulate Theo on catching a new Pokémon with a PDF attached! I'm planning to further develop the screen to make a poster friendly layout, so that he can put his favourite Pokémon up in bedroom, which would improve the solution even more, but for now I'm happy with the outcome.

I hope you enjoyed the first Episode of What's new in Power Platform - please join us again next week where I'll be diving into another great new feature!

To keep up to date with the latest posts, please follow me or What's new in Power Platform blog

#powerplatform #powerapps #poweraddicts #lowcodenocode #WNIPP

Venkata Subbarao Polisetty MVP,MCT

Head of Power Platform@fusionAix | Dynamics 365 CE and Azure Power Platform Architect| 3X Microsoft MVP |4X C# Corner MVP| MCT | Community Lead D365 Champs | Speaker |Blogger-YouTube Creator

1 年

Stuart Baxter , this is super awesome. My son would never leave this !

回复
Armand ARZOUMANIAN

Project Manager / Power Platform Developer & Administrator

2 年

We finally have that feature we've all been waiting for. No more HTML development of our PDFs haha Thanks for sharing!

Sarah Guest

Power Platform Consultant | Qualified Teacher | Expertise in Microsoft Stack: SharePoint, Power Platform, Project | Skilled in Power BI Report Building & Copilot Studio

2 年

Looking forward to trying this out and my nephew loves Pokémon too!

Chris Huntingford ??

Microsoft Sell dots.... I connect those dots! I am a dot collector, dot connector! Next: Microsoft Ignite, Chicago

2 年

Oh man this is great!!!!

Craig - you should follow Stuart. He is full of all Power App Guru knowledge.

要查看或添加评论,请登录

社区洞察

其他会员也浏览了