Everything is wonderful when we develop Canvas apps in Power Platform until it is time to import documents in PDF format.
There is no upload control for PDF documents!
There is no upload control for PDF documents!
To solve this challenge, we propose a simple solution:
Borrow attachment control from forms
An important detail to keep in mind is that this method is valid using both classic and modern forms.
How do we get the attachments control?
The first step to retrieve the attachments control is to create a table or use an existing one that contains a file type column.
Once we have the table, the next step is to insert the edit form control in our Canvas app and select the chosen table as a data source.
With the edit form inserted and configured to use the table with the file type column as a data source, we only need to add this field to the form and we will have the attachments control in our app.
Since we don’t need to work with the form, we borrow the control and delete the form.
When removing the form control, the errors tab alerts us that there are corrections to be made. Specifically, we need to modify the following properties:
- BorderColor
- DisplayMode
- Items
- Tooltip
- Y
After following these steps, we now have the attachments control to import PDF documents into our Canvas app.
I hope you find this article useful and you can apply it in your future developments. See you next time! 😊