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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / embed a PDF document i...
Power Apps
Answered

embed a PDF document into a powerapps form

(0) ShareShare
ReportReport
Posted on by 161

Hi Everyone,

 

I have a scenario in which upon New form is selected by the user; the resulting powerapps form that is opened; opens with a specific PDF document associated to the form. The background is that I have created a  vendor request form, and my business want to apply an email button in the form; which the requester can simply hit, and the new vendor receives an email from SharePoint with a blank banking details pdf attached. I have looked at collections, but the collection does not save the pdf document outside of preview. I have looked at workflows, but cannot find the right powerapps workflow button for this to work. I have also created a separate list which contain literally just the PDF form in it, but I cannot seem to get the button to reference the pdf document. I have spent 3 days solid on this now and I am completely out of ideas. Can anyone suggest how to embed a PDF document I can use in combination with a button to email that embedded document?

 

The screenshots shows what I have been trying re: email and the collection I have created by attaching the pdf to a copy attachments in powerapps; the problem is that as soon as I save and publish this form, that collection no longer exists when the user hits new form. The attachments is blank. 

 

Would really appreciate any help.

Categories:
I have the same question (0)
  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    I may need a little clarification, but you can create your collection in the App OnStart property and it will be created every time the app runs. Also, you may want to consider using a document library to hold your PDFs instead of the attachment of the SP list. You could take a look at his video - it may help:

    https://training.powerapps911.com/courses/take/video-library/lessons/8939812-email-attachments

     

  • pcoombe Profile Picture
    161 on at

    Hi @BrianS 

     

    Thankyou for your response. I know that video very well. It was down to that video that I was able to create the email. However the video only applies where you apply an attachment to the form manually. So I upload an attachment and email it over. In my case I want the attachment to always be there, but it doesnt appear on New form. 

     

    When you say 'OnStart' would you by chance have some example code to apply to the Onstart Property of the App. 

    Finally re: document library, how to bring a document library item into a powerapps form and then use that to email out to someone? 

     

    thankyou in advance

    Phil 

  • pcoombe Profile Picture
    161 on at

    Hi @BrianS 

    So if you see the image Onstart attached you can see where I have a ClearCollect attachment against my collection collectattachments. What I do not know is how to write the formula in OnStart to say point to another datasource where I have the PDF attached. Any help would be gratefully received. 

  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    The code you can put in App OnStart is the same as you put on a Button, or in many properties. Anything you want to happen before people access the app. I use it to set up permissions for various groups of people (emails in collections to check against the current user), Color palette designations, Collections of Department names, etc.

    You can set a variable with the path to the document you want to email. Then when you run the command to send the email, just use that for the attachment.

  • pcoombe Profile Picture
    161 on at

    Apologies I just cannot see how that would work. I need to be able to pull in the PDF from a library or list as a PDF and have it sit in an attachment. I can then reference that attachment in my email formula on my email button, but I have no idea how to write that in the OnStart function. Do you have an example? 

  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    You may want to watch this video:

    https://www.youtube.com/watch?v=u-b8w9ea1kk

    It deals with Document Libraries in general. They are really SP lists,  so you have to add them as a data source the way you do any list. Then you can put all of the PDFs you might need into that Library. Let's say that the PDF you want to send out the VendorRequest form and it has an ID of 2. In the App Start:

    Set(var_Doc, LookUp(Documents,ID=2).'Link to item' )

    Then when you want to send out the email :

    Office365Outlook.SendEmailV2(User().Email,"Subject","Here is a <a href="&var_Doc&">Link to your document</a>")

     

    I am pretty sure you can send it as an attachment, but I was getting error messages and did not want to send incorrect info

  • pcoombe Profile Picture
    161 on at

    Hi @BrianS 

     

    Appreciate your patience with me here. I'll look at the video and your advice and see what I can do. 

  • pcoombe Profile Picture
    161 on at

    Hi @BrianS 

     

    So I got so far but it is still not working. I was able to create a gallery and connect to my library doc and I could create a download button and see my document. I only have the 1 record in the doc library so didnt think I need to filter out id etc. However I cannot get the link into the button email. Also because this will be going to non company users emails i.e. hotmail etc, the link will not be sufficient. It really needs to be an attachment. 

     

    It is increasingly looking like this cannot be done in powerapps. 

  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    I think if you want an attachment you will have to use a Flow. You can call the Flow from the app and pass the email address and the name of the document, or you can hard code the document in the Flow if there will only be the one

  • ROB13 Profile Picture
    8 on at
    434434RERRER

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard