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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,179)