The Function I am trying to create is 'Cloning' a Users objectives, and assigning to a different user.
The app is an Objective Setting App for our company. A manager creates unique objectives and assigns to each member of their team (up to 15 objectives per user). And we would like the function of Cloning an employees objectives for another user in a similar role.
We have a SP list of 'Active Objectives'.
Currently I've created a gallery that's filtered by any items where the 'Employee Name' = the selected user (the user they want to clone). I have then tried collecting allItems from the gallery into a collection 'cloneCollect'
Now I'm trying to patch in the data in the collection into the Sharepoint list with a new 'Employee Name' value.
I looked into a couple similar issues people were having, and figured out that putting the Collection data into a Gallery 'collectionGall', with
cloneCollect' in the 'Items' field - and putting labels to populate the data. (shown Below)
and made a button to 'Clone' with the OnSelect properties as follows:
(for testing, I've just created 'txt_NewEmployee' input to manually put in a Users name to replace the 'Employee Name' field from the collection.
ForAll(collectionGall.AllItems,
Patch(
'Active Objectives',
Defaults('Active Objectives'),
{
'Employee Name': txt_NewEmployee.Text,
Year: Year.Text ,
Status: Status.Text,
Objective: Objective.Text,
Weight: Weight.Text,
'Objective Type': ObjectiveType.Text
}
)
);
Is there any obvious reason this isn't working?
I then have a gallery displaying all Items associated with the User manually entered into the 'txt_NewEmployee' field (to test if it's worked)