Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

polling ideas - "clone project" - use form, or patch directly

(0) ShareShare
ReportReport
Posted on by

I have an app which records projects. These are displayed in a gallery, together with a corresponding form in one screen.

The users would like a function to duplicate a project into a new record.

I'm thinking that it would be easiest if the duplicated project could be displayed in a form so users can verify/change data before saving the new record. Using the same form on the same screen however, seems like it would require using a collection as well as extensive modification of the default/defautselecteditems fields of the form (to fill the data from the collection).

Is there a better way of displaying the new record while duplicating?

Thanks!

  • BertP Profile Picture
    on at
    Re: polling ideas - "clone project" - use form, or patch directly

    Thanks @NandiniBhagya20 !

     

    Datasource is Dataverse...

     

    OK, so use patch to duplicate the record first, then edit after.

     

    My only hesitation is that my gallery has filtering/sorting applied, with the result that the default property of the gallery never displays the last submitted record, even though it is set to form.lastsubmit. So users always have to navigate to the last submitted record instead of having it pre-selected for them. Users therefore would have the extra step of going back to the gallery to select the newly duplicated record before they could view/edit it...

     

    I am still toying with the alternate idea of using a new form and pre-populating the fields with the contents of a collection (using the default/defaultselecteditem properties of the form). It just sounds like a nightmare to implement though...

     

    Are there any alternate ways to duplicate a form directly into a new or edit form and have it display the duplicated content without needing first to re-select the record from the gallery?

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at
    Re: polling ideas - "clone project" - use form, or patch directly

    Hi @BertP ,
    Can you please share the datasource you are using in your app.
    You can try using below steps to check if this works:
    1. Add EditForm instead of new form besides gallery control.
    2. In Item property of form, use LookUp(DataSourceName, ID = GalleryName.Selected.ID)
    3. Add a button to create duplicate entry. In OnSelect property of the button, use: Patch(DataSourceName, Defaults(DataSourceName), EditFormName.Updates)


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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard