Pragmatic Works Nerd News

Clone Dataverse Record(s) Directly From a Model Driven App!

Written by Nate Halliwell | Aug 19, 2026

In this tutorial, Nate Halliwell from Pragmatic Works demonstrates how to clone Dataverse records directly within a Model-Driven app using Power FX. This feature is relatively new and can save users from relying on third-party tools or outdated Power Automate actions.

 

Overview of the Process

Many users have been asking for a way to clone records in Dataverse without third-party tools. Nate addresses this by using Power FX, a low-code formula language in Power Apps. This solution is especially useful since the "For a selected record" action in Power Automate has been deprecated.

Setting Up the Model Driven App

To start, Nate uses a simple model-driven app with a Dataverse table named "YouTube Video Ideas." This table contains fields such as the video name, idea description, goal date, and status. The goal is to create a duplicate of these records without manually inputting the data again.

Steps to Clone a Record

  1. Edit the Command Bar

    To enable the cloning feature, navigate to the left panel in the app, open the tree view, and select the page where you want to add the function. Then, select "Edit Command Bar" to customize the commands on that page.

  2. Create a New Command

    Choose the "New Command" option and decide if you want to create a Power FX or JavaScript function. For this tutorial, Nate focuses on Power FX. This allows the addition of a custom button to clone records.

  3. Set Visibility Conditions

    In the visibility section, configure the button to only appear when records are selected in the grid. Use the isEmpty function to show the button when at least one record is selected.

  4. Using Power FX to Clone Records

    The next step is to write a Power FX formula using the Patch function. Nate uses a ForAll loop to iterate through the selected records, copying their details to create new entries in the table.

  5. Customize the Patch Function

    In the Patch function, the defaults command is used to create new records in the "YouTube Video Ideas" table. Nate demonstrates how to set the "video name" and "description" fields, using concatenation to indicate that the record is a clone.

  6. Testing the Clone Function

    After saving and publishing the changes, Nate tests the new functionality. With one or more records selected, the new button appears in the command bar, allowing users to clone records with a single click. The clone records are automatically created with the same data as the original, but with a new name indicating it is a clone.

Conclusion

This solution provides a simple and effective way to clone Dataverse records in a Model-Driven app. It eliminates the need for external tools and offers an easy-to-implement method using Power FX. This method can be especially useful for users working with multiple records or needing to create clones of complex tables with many fields.

By following the steps outlined in this tutorial, users can streamline their workflow and create clones of their Dataverse records with ease. The method Nate demonstrated is an excellent addition to any Power Apps developer's toolkit.

About Pragmatic Works

Pragmatic Works provides training, resources, and expert-led lessons on Power Apps and the broader Microsoft Power Platform. To learn more, check out their other tutorials and training programs.

Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on Model Driven App and other Microsoft applications. Be sure to subscribe to the Pragmatic Works YouTube channel to stay up-to-date on the latest tips and tricks.