Showing results for 
Search instead for 
Did you mean: 

Use Copy() function to copy and paste tabular formatted data from Power Apps to Excel

When we copy a selection of cells from Excel, and paste the contents into Notepad, we can notice that:

  1. Columns are separated by a tab
  2. Lines are separated by a carriage return

We can therefore use the Concat() and Char() functions to reproduce this format. In the following example, we are going to use a "Sample List", which contains the columns:

  • Name (type text)
  • Number (decimal type)
  • Choice (choice type)
  • DateTime (DateType)
  • YesNo (Boolean type)
  • ImageUrl (Type Text)

we are going to add a button or an icon with the following code in its OnSelect property:



        'Sample List',
        Name & Char(9) & Number & Char(9) & Choice.Value & Char(9) & Text(DateTime,DateTimeFormat.ShortDateTime,"fr-FR") & Char(9) & YesNo & Char(9) & ImageUrl,
);Notify("All gallery data copied to clipboard",NotificationType.Success)





We concatenate the values of each line, separated by a Char(9) which is the tab character.

We define the separator of our Concat() function with a Char(13) which is the code for the carriage return character.

We then add a Notify() to let the user know the data has been successfully copied to the clipboard.


At this point, this is what the contents of the clipboard look like:



Lorem *	712.54	Choix 3	08/11/2022 13:15	true
Ipsum	196.22	Choix 2	05/09/2022 05:30	false
Dolor	504.39	Choix 3	02/09/2022 09:00	true
Sit	175.74	Choix 2	06/11/2022 08:00	false
Amet	634.15	Choix 3	30/09/2022 09:00	true
Consecutor	814.4	Choix 1	08/09/2022 09:00	false
Drecuasers	361.67	Choix 1		false
Rolmunaris	672.19	Choix 3		true
Sin Pecador	421.37	Choix 1		true
cansuilis	43.79	Choix 1	23/11/2022 00:00	true
Veritas	852.33	Choix 1	15/11/2022 00:00	true
Nouveau	9.5	Choix 1	15/12/2022 15:30	true



But once pasted into Excel, each value is housed in its cell!