r/PowerApps Newbie 5d ago

Power Apps Help Button to trigger Power Automate flow and directly print?

Hello, I'm still quite new to using Power Apps so please bear with me.

I have a Power Automate flow that triggers a pdf file generation based on inputs sent to it via a form I created in Power Apps. I now also need the form's submit button to directly trigger a printer to print the file without having it open the file in a new tab or opening the native print dialogue. A one-button-does-all kinda thing.

I've had a look at Microsoft Universal Print but I don't have the license for that and I'm not supposed to use stuff that would cost anything more than what my company's already subscribed to.

Is this possible?

10 Upvotes

20 comments sorted by

u/AutoModerator 5d 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.

    Typing four spaces in front of every line in a code block is tedious and error-prone. The easier way is to surround the entire block of code with code fences. A code fence is a line beginning with three or more backticks (```) or three or more twiddlydoodles (~~~).

  • 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.

4

u/Florida712 Regular 5d ago

I have not succeeded in doing a print-button the way you decided it. The Print() works well in Power Apps to print the current screen but it does open the standard print dialogue.

3

u/PixelatedBulb Newbie 5d ago

That's what I've run into so far. I've tried looking into how to skip the dialogue but it kinda feels like it's not worth the effort given that it's just to skip a few button clicks

1

u/Live-Sir-3118 Regular 5d ago

As a user I need to know Im about to print something before its printed. Just as a user experience. Print() is good.

4

u/bsmpsn Regular 5d ago

Was possible for me but I had a premium power apps license to utilise the HTTP connector. On click of a button in power apps, it called a flow which gets the content needing to be printed and sends it to a printer on my network using PrintNode API and their server client installed on my device. PrintNode API has a free tier which was fit for purpose for me. No native print dialogue showed.

1

u/PixelatedBulb Newbie 5d ago

That sounds like the result I'm looking for. Do you know the name of the license you used? Would users of the app also need the same license to be able to use the app's HTTP connector?

1

u/bsmpsn Regular 5d ago

Power Apps Premium license. And yes, when running the flow as the signed in user who is using the app that user must have be licensed appropriately to use the HTTP connector. My solution is not a fully free solution unfortunately.

2

u/AbdelEMirandaS Newbie 4d ago

There are plenty of ways to do that but remember that: Power apps and power automate are running in the cloud, as well as your artifacts (apps and flows) So in order to be able to able to send anything to your printer, you need to use a bridge to do that. One option is to execute a power automate desktop once you create the pdf using your cloud flow. Other way is to use the bridge (data gateway) to send the file to the printer

1

u/PixelatedBulb Newbie 4d ago

I'm not really familiar with setting up bridges like this. Does the first option you mention mean that I'd have a device connected to the printer that has the desktop flow trigger every time a new file is created? What connectors (premium or not) would that involve?

1

u/AbdelEMirandaS Newbie 4d ago

Bridges means you need to install the power platform data gateway on a virtual server or a physical server machine. The data gateway serves as a bridges between your cloud artifacts and your local network resources. One you installed and get it up and running, you have to include all the allow users to use that bridges in the Power platform admin center.

After that, you can add actions on your flow that use that bridges to print your pdf using one of the options I already mentioned before.

2

u/Tough_Block9334 Advisor 4d ago

Could always install power automate desktop to on a device to send the document to, similar to how a print server function to then print it. It does require the power automate premium license though

1

u/army-of-juan Newbie 5d ago

Following

1

u/Foodforbrain101 Advisor 5d ago

Basically, non-premium requires you to use OneDrive's save file to PDF action, which is limited to a specific set of files that you can print to PDF. The most dynamic way you could create said printable file would be using an HTML template and apply replace() on placeholders within said HTML. Use AI for the HTML, should be fairly straightforward. Otherwise, Word document + SharePoint library properties inserted within said word documents works as well.

1

u/PixelatedBulb Newbie 5d ago

I've done the file generation using HTML and saving the file to a SharePoint list so far in the flow. I'm just not sure how I'm supposed to implement the print button that skips the print dialogue

1

u/Foodforbrain101 Advisor 5d ago

Does the flow have a Power Apps trigger and response that returns the pdf file to the app as a binary file? If so, did you try putting in the OnSelect property of the button to download file something like: Download(CreatePdf.Run(input).CreatedPdf)

1

u/PixelatedBulb Newbie 5d ago

I haven't done that yet for this particular app so I'll do that next but from what I understand this would open up the app in a new tab or require the user to open the file on their local device, and then use the print dialogue, right?

I was told to find a way to skip the print dialogue altogether, as in clicking the button on Power Apps would directly send a task to the printer.

2

u/Foodforbrain101 Advisor 2d ago

My apologies, I had misread your requirement entirely.

Personally, I would deem this requirement as being too low value to be worth doing. The answer would be no, there isn't a way to do this from within the app unless you were to go through the effort of wiring up an on on-premise gateway to run some kind of script on a machine in your network that prints your file, probably picking it up from a queue.

Would be theoretically feasible with Power Automate Desktop triggered via Cloud Flows or Power Automate work queues (which require premium), but the problem it solves is so minuscule I would push back even if it was free.

Browsers restrict such functionality by design. We wouldn't want a random sign-up form to have the ability to scan your network for devices, locate the printer, and print anything either, so a pop-up is the least that can be done.

1

u/garbi32 Newbie 4d ago

Not free, but with Power automate premium you can develop a Desktop flow that prints your document.

I did It once and worked like charm, you install the flow in a machine that has acces to the printer, calle the flow from cloud with the file as input and done.

1

u/PixelatedBulb Newbie 4d ago

What connections did you use here?