The Goal
Create a PDF file in a folder on OneDrive.
The Attempts
The punch line here is that no data is being recorded in Power Automate.
I have
- enabled "PDF function" in "Upcoming features", "Experimental"
- Created a Flow (if this can be done wholly in Power Fx, that is great, too)
* The precise Flow seems unimportant right now, as I can't seem to pass any information to Flow
- Added this code to my Power App, Canvas App
SavePDFToOneDrive.Run({PDFContent:PDF('Quick Look')})
From my Flow, in the Power Apps (v2) trigger, I don't get any data (Content-Length: "0",):
The Result
No data is received in the Power Automate Flow
The Ask
How can I get a PDF of a screen in Power Apps saved to OneDrive
The Thanks
Thank you for your assistance with this. This has been a maddening experience, and I am very much looking forward to a successful conclusion to this, so, again, thank you!! You rock!!! 🤘
The simple solution involves leveraging graph, like so:
Set(_now, Text(Now(),"yyyy-mm-dd_hhmm-ss"));
Navigate('Completion Tracker',ScreenTransition.Cover);
Set(
strPDFCompletionTrackerTTL,
Concatenate(
"CompletionTracker_",
_now,
".pdf"
)
);
Set(pdfCompletionTracker, PDF('Completion Tracker', {Orientation: "Landscape"}));
Office365Groups.HttpRequest(
$"https://graph.microsoft.us/v1.0/me/drive/root:/" & strPDFCompletionTrackerTTL & ":/content",
"PUT",
pdfCompletionTracker
);
A more abstracted version of the graph call is:
Office365Groups.HttpRequest(
$"https://graph.microsoft.us/v1.0/me/drive/root:/" & <PDFFileTitle> & ":/content",
"PUT",
<PDF Content>
);
I imagine this will help a lot of folk; I certainly hope so.
Hi @BenDonahue,
Indeed it looks like that.
May I ask if you tried using this guide in the official documentation of the function to get things to work? Work with the PDF function (experimental) - Power Apps | Microsoft Learn
After switching up the data transfer from File type to Text type, I places a Compose right after the trigger to report on the data being transferred, and this is what I got:
appres://blobmanager/4c36f93356c04f7e8431b42706c49db0/4
This might be real promising; is this referencing a location where the PDF data in Text form can be found?
Hi @BenDonahue ,
I was about to write a formula to test when I noticed you are trying to pass a record to Power Automate and I think the issue is there. Can you please try with the below formula where the output of the PDF function is passed to Power Automate as a text?
SavePDFToOneDrive.Run(PDF('Quick Look'))
And there's the rub; choosing a File type to receive in Power Apps, nothing is being received ion the Run() call.
Hi @BenDonahue ,
If you can capture the file content in a variable, the PDF function should indeed not be the issue. Next step in testing is to try and pass the value of the variable to Power Automate.
Hello @BCBuizer,
First, thank you for your time and help.
Yes, "Quick Look" is a screen name. Once I save the PDF to a variable, I can see the PDF using the PDV viewer control, so I know that part is working. This issue, I believe, is handing that data over to Power Automate; I could be mistaken.
Hi @BenDonahue ,
To get it out of the way: As you noticed the PDF function is an experimental feature which may break / be removed without prior notice and should hence not be used in production.
Can you please confirm 'Quick look' is the name of either a Vertical Gallery, Vertical Layout Container, Horizontal Layout Container, Container, or Screen? These are the only supported objects: PDF function (experimental) - Power Platform | Microsoft Learn
For testing, you could try saving the output of the function to a variable and see how that comes out?
WarrenBelz
89
Most Valuable Professional
MS.Ragavendar
60
stampcoin
48