Hi all,
I have a SP list called 'Task' containing items and a lookup column called ParentTask linked to the ID column in the same 'Task' list.
What I want to achieve is basically users to link certain items together to 1 masteritem. Sort of like a sub-task within a larger task.
I have a gallery "galLinkItems" filtering the items from my SP list so the gallery contains possible sub-tasks for the larger task and in the gallery I have a combobox / checkbox for each item in the gallery for when the user wants to link the item as a sub-task to the larger task.
The larger task is displayed in a form called frmTaskSchedule so my larger task ID is in there.
I assume i need to use ForAll and Patch but i can't get it to work.
Any help would be greatly appreciated.
Thanks!
Hans
Solved! Go to Solution.
Solved!
Below did the trick. My ParentTask column in my SP list was a lookup column. I have re-created the column as a number and now it all works.
ForAll(
Filter( galSubTask.AllItems,
cbSubTask.Value = true
),
Patch( Task,
LookUp( Task, ID = Value(lblSubID.Text) ),
{ ParentTask: Value(lblMainID.Text) }
)
)
@Lennova : how are you plan to link the sub-task with main task.? what I mean here is... are you using Combobox or Checkbox (If checkbox, how user will know which task it should be assigned to?) .. Combobox I can understand that it can be list of tasks which don't have task ID assigned hence these are parent tasks and then on selection of it.. we can patch it.. but can you share more insights on the approach you would like to take..? also the use of Form ?
Hi Sunil,
I have a screen where a form displays details of the main task. On that same screen I have a gallery where possible sub-tasks are displayed. In that gallery i have a checkbox for each sub-task.
User will turn checkbox to on when they want to link the main task to that sub-task. User will click a save button that will patch the main task ID in the parenttask column in my SP list when the checkbox for that specific sub-task has been checked.
@Lennova.. what is the Item property of your Form? how are you selecting you Main task?
Hi Sunil,
The main task is selected in a gallery on a different screen. So, my form is populated with the ID of the task.
Solved!
Below did the trick. My ParentTask column in my SP list was a lookup column. I have re-created the column as a number and now it all works.
ForAll(
Filter( galSubTask.AllItems,
cbSubTask.Value = true
),
Patch( Task,
LookUp( Task, ID = Value(lblSubID.Text) ),
{ ParentTask: Value(lblMainID.Text) }
)
)
User | Count |
---|---|
260 | |
127 | |
101 | |
49 | |
47 |