Hello,
Background:
I am working on building a timetracking app for our project teams to use. In it, on the CREATE NEW TIMESHEET page, users can select a checkbox and choose to copy activity line items from a previous week's timesheet (timesheet data stored in Dataverse). I was able to pull the previous week's timesheet data into a collection for use in the timesheet, however it then needs to be added into a new collection which has additional columns, filled with values from the form.
Question:
How can I add into a collection (collect, patch, etc.) values which in part take from this existing collection (previous timesheet activities rows {Activity, ProjectNum, HoursMon, HoursTue, HoursWed, etc....}), and add additional static values filled out in the form at the same time (ex: TimesheetStartDate, TimesheetResourceID, TimesheetStartDate), which represent identification of the newly created timesheet that these line items must match to.
Additionally, the columns coming from the dataverse table and the collection are different, so I need to relate the dataverse column names to match to the collection names.
Here is the Collect() function I use in the next segment of the app to add an individual row into the collection. I just can't figure out how to modify it so that all the values from the previous weeks data can be added in at once.
If(IsBlank(ddTSCopyFromDate.Selected)=false,Collect(colNewTSLineItems,{
PrjNumShort: {Needs to be fed from each line of the other collection},
prjNamDesc: {Needs to be fed from each line of the other collection},
Activity: {Needs to be fed from each line of the other collection},
prjWBScode: {Needs to be fed from each line of the other collection},
hrsMon:{Needs to be fed from each line of the other collection},
hrsTue: {Needs to be fed from each line of the other collection},
hrsWed: {Needs to be fed from each line of the other collection},
hrsThu: {Needs to be fed from each line of the other collection},
hrsFri: {Needs to be fed from each line of the other collection},
hrsSat: {Needs to be fed from each line of the other collection},
hrsSun: {Needs to be fed from each line of the other collection},
hrsTotal: {Needs to be fed from each line of the other collection},
Ref_TimesheetID: LookUp(colNewTSRecord,lblNewTSEmployeeID.Text=Resource_ID,Timesheet_ID),
Ref_TimesheetStartDateID: LookUp(colNewTSRecord,lblNewTSEmployeeID.Text=Resource_ID,Timesheet_WeekStartDate_ID),
Ref_TimesheetResourceID: LookUp(colNewTSRecord,lblNewTSEmployeeID.Text=Resource_ID,Resource_ID)
}),"")