web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Bug - Editor duplicate...
Power Apps
Unanswered

Bug - Editor duplicates custom component on copy/paste

(7) ShareShare
ReportReport
Posted on by 36

Repro steps:

  1. Create a custom component C
  2. Create a screen S
  3. Add custom component C to screen S
  4. Duplicate screen S

Actual result:

Screen S_1 contains an instance of component C_1.

Component C_1 is a duplicate of C.

 

Expected result:

Screen S_1 should contain an instance of C.

 

Please note this behavior also happens when copy/pasting components from a screen A to a screen B.

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

    This isn't a bug this is what is meant to happen as the object names are unique to the app and not the individual screen.

     

    Once they have been copied to a new instance the system will rename it by adding a number on the end to differentiate it.

     

    You can then rename to duplicate to whatever you want provided that name isn't already being used by another object in your app

    Jamie

  • cchsod Profile Picture
    36 on at

    Hi @Anonymous ,

    I'm sorry I was not clear enough in the bug description.

    The problem is not that the new instance has a suffix "_1".

    The problem is that the custom component itself (ie the template) is duplicated.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

    If you are duplicating the page then everything within the page will also be duplicated with it. If you don't want the component to be duplicated then either make a new page and copy everything else over or cut it, duplicate the page then re add it to the original page.

    Jamie

  • cchsod Profile Picture
    36 on at

    Thank you @Anonymous for this workaround.

     

    However I feel this is an unexpected behavior, as it really impacts the usefulness of custom components.

    The whole purpose of custom components is to be able to build reusable pieces of UI that you can edit in a single place.

    When I duplicate (or copy/paste) usages of my component N times, I don't want the component itself to be duplicated N times, because now I would have N places to update every time I want to make a change to my component.

     

    I would really like to hear the product team's point of view on this subject.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

    If it is an inputted value to a component you are concerned about each time it is duplicated then you can get around this by setting this value as a variable which can be set elsewhere on the screen or in the app before you duplicate.

    If you don't want the component to be copied across then the best option would be to copy the page with the component then delete and copy from the copy.

    Jamie

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Jamie, you are entirely missing the actual problem.
    The problem is that the "Reusable" Component itself is being duplicated when an INSTANCE of that component is copied, even from one container to a different container on the SAME SCREEN.

    TRasor_0-1670946935585.png

    This is what that looks like. None of the Components in the list were created by hand. PowerApps decided it should create them on its own.
    All of these duplicate components are created after copying one Container containing several instances of the "Resusable" Component to different container that was previously empty. This is easy to reproduce and incredibly annoying to fix, because now all of the pasted controls are tied to their own NEW DUPLICATE COMPONENT. Deleting the duplicate component now causes the instanced controls which now depend on it to be deleted as well.
    Components are fundamentally broken by this behaviour, as the entire point is to use multiple instanced controls that are tied to ONE single reusable component.

  • mikefju Profile Picture
    14 on at

    I agree with @cchsod that this seems like a bug in PowerApps.  As a PowerApps developer, it requires a lot of extra time on the developer by not automatically reusing the same Component.  If the developer doesn't keep up, it can get quite out of hand.  Every time I copy screens, I end up deleting the duplicate components and then re-inserting them manually.  Then any custom inputs need to be manually copied over from the original screen.  It is very time consuming.

     

    Has anyone found a better workaround to be able to copy Screens and have the Components point to the original Components rather than creating duplicates?

  • Franzi Profile Picture
    33 on at

    Hi, I've got the same issue and I want to follow this post. 

  • emaschas Profile Picture
    11 on at

    I fully agree that the custom componant should not be duplicated !

    The interest of these components is to have the same object anywhere in the app.

    This way you don't need to modify every instance if you want to change something in its design.

  • mgreiner79 Profile Picture
    37 on at

    I totally agree with @cchsod . This is not expected behavior, and makes the idea of components pretty useless. The whole idea of components IMHO is the DRY (don't repeat yourself) principle. That is, define the component once. Instantiate it many places. Any time you need to update the component, you only need to change it in one place.

    I have built a rather large app over the last month, not realizing that this was happening. Now I look at my components page and have hundreds of component copies. I dread the day I am going to need to make a change to one of these components.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard