cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
todaytoo
Frequent Visitor

Copy/Duplicate records Canvas App

I am wanting to copy the records for the previous day into the currently selected day. The current patch statement to create a record is below, I cannot figure out how to reference the records in the prior date and copy to new date when the copy icon is selected. Does anyone have any suggestions / pointers?

 

 

This is comprised of a horizontal and nested vertical gallery.

 

Horizontal Gallery: Date_Gallery

Nested Vertical Gallery: Capacity_Detail_Gallery

 

When the + Icon is selected it creates a new record for selected values from the galleries in the image:

 

Patch(

    'CAPACITY DETAIL TRACKERS',

    Defaults('CAPACITY DETAIL TRACKERS'),

    {'Capacity Main LookUp': Project_List_Gallery.Selected},

    {'Capacity Date LookUp': Date_Gallery.Selected},

    {'Capacity Resource LookUp':Resource_Gallery.Selected},

    {'Capacity Value': 'Capacity Value (CAPACITY DETAIL TRACKERS)'.'0'}

);

Notify(First(Errors('CAPACITY DETAIL TRACKERS')).Message);

1 ACCEPTED SOLUTION

Accepted Solutions
JayMagness
Solution Specialist
Solution Specialist

Like most things in technology there are a million ways to solve this but I like to take the easy way out. 

 

I see so many people writing miles of code but Powerapps does not need this. 

 

add a gallery and have it filter to the day before and whatever else you need to filter to get to the 1 previous days record.

then add a view form and ad the item in the form to get the record that is select form the previous record.

 

then finally I would make the new days form filed default values to each in the form that has the selected data. 

 

the make the gallery and the view form invisible.

 

This is all good because you may not want the previous days data but the data that could be two days before because of Holidays and weekends. this just how I would do it.

View solution in original post

1 REPLY 1
JayMagness
Solution Specialist
Solution Specialist

Like most things in technology there are a million ways to solve this but I like to take the easy way out. 

 

I see so many people writing miles of code but Powerapps does not need this. 

 

add a gallery and have it filter to the day before and whatever else you need to filter to get to the 1 previous days record.

then add a view form and ad the item in the form to get the record that is select form the previous record.

 

then finally I would make the new days form filed default values to each in the form that has the selected data. 

 

the make the gallery and the view form invisible.

 

This is all good because you may not want the previous days data but the data that could be two days before because of Holidays and weekends. this just how I would do it.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (2,638)