Skip to main content

How to Copy and Paste Controls Between Screens in Power Apps

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

When a second screen needs the same header as the first, you don't have to build it again. Copy the header container on one screen and paste it into the other: every control inside it comes along, with all its settings. You only rename the copies and change what's different.

Prerequisites​

  • Two screens, and something worth reusing on the first one. The example copies conHeaderHS, the header from the Career Development Plan app's Home screen (Part 4), to the new My Plan screen. On the new screen, the screen container conMainMPS already exists (How to Add a Vertical Container in Power Apps).

Step 1: Copy the Control​

In Tree view, hover over the control, select ... and choose Copy. Copying a container copies everything inside it. Ctrl+C does the same (Use code view for canvas app controls).

The Tree view with the ... menu of conHeaderHS open, listing Reorder, Cut, Copy, Paste, Delete, Rename, Remove container, Collapse all, Expand all, New comment and View code, with Copy outlined in red

Step 2: Paste It Where It Belongs​

Open the ... menu of the place it should go, here the screen container conMainMPS, and choose Paste:

The Tree view with the ... menu of conMainMPS on My Plan Screen open, and Paste outlined in red

The copy lands inside that container. Microsoft notes that controls pasted into a layout container are placed by their order in Tree view (Building responsive canvas apps). To change the order afterwards, see How to Reorder Controls in a Container in Power Apps.

Step 3: Rename the Copies​

Control names must be unique across the whole app (Code readability), so Studio adds _1 to each copy. In the example, conHeaderHS_1 and lblTitleHS_1 appeared:

Tree view of My Plan Screen with conMainMPS containing conHeaderHS_1, outlined in red, and lblTitleHS_1 inside it; on the canvas the new screen now has the teal header with the title Career Development Plan

Rename each one (How to Rename a Screen or Control in Power Apps): the example's became conHeaderMPS and lblTitleMPS, with MPS for My Plan Screen.

The settings came along unchanged. The copied header still had Fill App.Theme.Colors.Primary, Height 64 and PaddingLeft 24, and the title kept its heading Role. Only the text needed changing, to "My plan".

Common Mistakes​

MistakeWhat happensDo this instead
Pasting with the wrong control selectedThe copy lands in the wrong containerUse Paste from the ... menu of the target container
Keeping the _1 namesFormulas and Tree view are hard to readRename each copy

Troubleshooting​

SymptomLikely causeFix
The copy appears in the wrong place in the containerIt was inserted by its Tree view orderReorder it
The copy is outside the container you wantedIt was pasted with another control selectedUndo, then paste from the target container's ... menu
A copy pasted on a gallery lands outside its rowsPaste was chosen on the gallery itselfUndo, then paste on a control inside the row (Fixed: New Control Lands Outside the Gallery)
There's something wrong with the pasted codeThe clipboard no longer holds the control, for example after you copied a formulaCopy the control again, then paste (Fixed: "There's Something Wrong with the Pasted Code")

FAQ​

Does the copy stay linked to the original?​

No. In the example, changing the copy's text to "My plan" left the Home screen's title as it was.

Why did Studio add _1 to the names?​

Because two controls in one app can't have the same name. The copies need their own names, so rename them to match the new screen.

Conclusion​

Copy in Tree view, Paste on the target container, then rename the _1 copies. Every setting comes along, so a header takes seconds instead of a dozen steps.

Additional Resources​

Stay Updated

Subscribe to our newsletter for the latest tutorials, tech insights, and developer news.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.