I was recently required to copy the data from the Power Apps gallery to Excel in a table format. Power Apps provides a useful function called the Copy() function to achieve this quickly.
In this article, I will explain the Power Apps Copy Function, its syntax, and how to use the Copy function in the Power Apps Canvas app. Along with that, we will also discuss the topics below:
- How to copy text to the clipboard in Power Apps
- Power Apps copy the table to the clipboard
- Power Apps copy the collection to the clipboard
Power Apps Copy Function
The Copy() function in Power Apps copies the text value directly to the clipboard. This function accepts any text string as its argument. We can use this function in any behavior properties(e.g., OnSelect, OnChange), typically triggered by user actions like clicking a button or icon.
Syntax:
Copy(text)
The copy function is limited to the app’s host’s access to the clipboard. Therefore, embedded apps, such as those in SharePoint, Power BI, or Teams, do not support this function.
Let’s see an example of copying the text to a clipboard.
Power Apps Copy Text to Clipboard
Look at the example below. When I click on the copy icon, the email in the text input control is copied and can be pasted into another text input control.

Follow the steps below to achieve the above example.
1. In Power Apps, add two text input controls for copying and pasting the email text.

2. Add a copy icon from the +Insert tab. Then, add the code below to its OnSelect property.

Now, save the changes. While previewing, provide an email in the text input control and click on the copy icon. Then, on the following input control, paste the copied text by clicking ctrl+ V on the keyboard.
Power Apps Copy Table to Clipboard
Look at the example below. I have displayed details of the upcoming workshop in the Power Apps gallery. After clicking on the copy icon, the details are copied, and then in the Excel sheet, when I click Ctrl + V, the details are displayed in table format.

Follow the steps below to achieve this!
1. In Power Apps, add a gallery control and connect it with the SharePoint list by providing the list name in its OnSelect property.
'Upcoming PowerApps Work Shops'
‘Upcoming PowerApps Work Shops’ is the SharePoint list name.

2. Provide the below formula on each label’s OnSelect property within the gallery control.
Copy(Self.Text)
Self.Text will take current data.

3. Add a copy icon and provide the below formula on its OnSelect property.
Copy(
Concat(Gal_WorkshopDetails.AllItems,
lbl_Title.Text & Char(9) & lbl_Date.Text & Char(9) & lbl_presenter.Text & Char(10)
)
);
The Concat function will concat all the details in each text label in the Power Apps gallery control.
- lbl_Title = Contains workshop title
- lbl_Date = Contains the workshop conducted to date
- lbl_presenter = Contains the workshop conducted presenter name

4. Now, save changes and preview the app. Then, click on each label in the Power Apps gallery control and click on the copy icon. In Excel, click on ctrl+V, and you’ll see the copied data in the excel.

Power Apps Copy Collection to Clipboard
With the Power Apps copy function, we can copy the collection to a clipboard and paste it anywhere. In the example below, you can see I have created a col