Canvas App:

In this blog, we will discuss the functionality where clicking on the attachment icon opens a pop-up screen, displaying the attached files such as images or PDFs.

Create a canvas app based on your requirements and add an icon in the gallery. Here is the canvas app screen that I have created.

Canvas App

If you look at the screen, an attachments column is present, and an icon is placed within it to trigger the pop-up screen

Now, in the OnSelect property of that icon, write the following

Set(Popup,true);
Set(AttachmentURL,”https://crmoncee.sharepoint.com/_layouts/15/getpreview.ashx?path=” & First(ThisItem.Attachments).AbsoluteUri)

From the above Popup, AttachmentURL are variable names ,You can change it based on your convenience and replace this part of Url https://crmoncee.sharepoint.com  with your Sharepoint account Url 

Add a container to the screen and place it above the gallery. Adjust the width and height of the container according to your preference 

In the Visible Property of the container write  the variable Popup

Add a Cancel icon and Image control inside the container 

On the OnSelect property of the Cancel Icon write the following

Set(Popup,false)

In the Image property of the Image, write the following

AttachmentURL & “&resolution=6”

Now, it’s time to check whether the pop-up screen is working or not. Attach a file to a record and verify

Click on the attachment icon of a specific record and see the pop-up screen appear, displaying the attachment

For any Help or Queries Contact us on info@crmonce.com or +91 9493926112

https://www.crmonce.com/how-to-convert-the-text-area-field-into-option-set-field-in-power-pages/