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,