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 / using existing record ...
Power Apps
Unanswered

using existing record to create

(0) ShareShare
ReportReport
Posted on by 6

Hihi,

I am junior for using powerapps. I have below question and hope to get help

 

the record is already in the database. however, I would like to edit this record and then save as a new transaction. How can i do that? Please kindly help

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @ArthurLin 

     

    If I understood this correctly, you want to create a new record by using the values from an existing one.
     
    For this, you can create an Edit Form, select the data source, and set the "Item" property to point to specific record using expression:
     
    LookUp(DataSourceName, Title = "Test")
    This will get the first record matching the criteria.
     
    Now, you can create a button to save this record to datasource.
     
    Button -> OnSelect -> Patch(DataSourceName,Defaults(DataSourceName),{Title:DataCardValue2.Text,Choice: DataCardValue5.Selected.Value})
     
    Here, DataSourceName is the name of data source. Title and Choice are the name of columns, while DataCardValue2/DataCardValue5 refers to the name of controls.
     
     
    In you need specifics for the formula, please share more details about the logical implementation.

     

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • SaWu Profile Picture
    635 on at

    Hi @ArthurLin 

    As @yashag2255 already pointed out, you can use Patch to create copies of records, using Defaults for the BaseRecord argument of Patch.
    You can also use your original record (that you want to copy) as ChangeRecord.
    This might be easier than explicitly listing every control in the form, and making sure the form has all necessary controls, in order to get a full-enough copy.

    If you use your original record in this way as ChangeRecord, you might have to drop the read-only columns (only for the use in Patch as ChangeRecord) which get set automatically by the Database/Dynamics/CDS (e.g. guid fields, createdby, createdon...).
    Otherwise PowerApps (i.e. the CDS connector) might yield an error on your actual attempts to use Patch.
    Those kinds of errors won't appear in the App Checker before actual execution.

    With CDS/Dynamics, you can also replace Defaults with a record containing only a Blank() guid field to force the creation of a new record instead of overwriting an old one.
    image.png
    Here's a more explicit version of what I'm trying to convey:

    Patch([@DataSource],
     {
     GuidField: Blank()
     },
     originalRecord
    )


    Good luck,
        Sa.

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @ArthurLin ,

    How do you edit existing record of your data source within your app? Using Edit form?

     

    I assume that you use Edit form to edit an existing record in your data source within your app, based on the needs that you mentioned, I think the Patch function could achieve your needs.

     

    I have made a test on my side, please take a try with the following workaround:

    Within your Edit screen (which contains Edit form), add a Button called "Existing to New", set the OnSelect property to following:

    Patch(
     'YourDataSource',
     Defaults('YourDataSource'),
      EditForm1.Updates /* <-- EditForm1 represents the Edit form in your app to edit the existing record */
    )

    Please take a try with above solution, check if the issue is solved.

    After you edit your existing record within the Edit form, click the "Existing to New" button, then it would save the modified existing record into your data source as New record.

     

    In addition, you could also consider set the OnSelect proeprty of the "Submit" button within your Edit form to following:

    Patch( /* <-- Add this formula */
     'YourDataSource',
     Defaults('YourDataSource'),
      EditForm1.Updates /* <-- EditForm1 represents the Edit form in your app to edit the existing record */
    );
    SubmitForm(EditForm1)

    When you press the Submit button, it would update existing record in your data source, and create a new record using the modified existing record at the same time.

     

    More details about the Patch function, please check the following article:

    Patch function

     

    Best regards,

  • SaWu Profile Picture
    635 on at

    Hello @v-xida-msft 

    Does using Form.Updates actually work for creating proper copies?
    I was under the impression that Form.Updates only produced something like a "diff" record with changes.
    So, as far as I understand, this won't be creating a full copy unless you have every field in the form and actually change every field.
    Please, do let me know whether my understanding is wrong.

    Thank you,
        Sa.

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard