How to Copy to clipboard from Power Apps canvas apps

Hello everyone and welcome to my blog. In today’s blog I will show how you can access clipboard in Power Apps canvas apps.

Through my blog I share interesting tips and discuss on latest releases of Microsoft.NET technologies, Dynamics 365 and Power Platform, SharePoint and Client scripting libraries. Please subscribe to my blog to stay updated.

Let’s get started. Power Apps has an inbuilt Copy function that can take any text input and put it in your clipboard. Let’s demonstrate this through an example.

In below illustration I have a read-only text that should be copied to clipboard. While it is pretty simple to copy and paste while using a Power App in web browser, users using it on mobile sometimes find it difficult.

The text should be copied on click of the button – “Copy to Clipboard“.

In the On Select event of the button, I use the Copy function to copy the content. TextInput1 is the name of the control which contains the text to be copied.

Copy(TextInput1.Text)

There is one more advantage of the Copy function. The Copy function can use expressions and formulas for dynamic values. For example in the below code I copying only the first 10 characters of TextInput1 to the clipboard along with some dynamic text prepended.

Please bear in mind that in the current version, the Copy will not work in embedded Power Apps scenario. Few examples include – A power app embedded inside SharePoint, A power app embedded inside Power BI.

Hope this helped. For similar interesting topics on Microsoft.NET and Power platform, you can subscribe to my blog.

Debajit Dutta
Business Solutions MVP