I have a SharePoint list in which I will create multiple new items with multiple same columns except one.
Date // Name // Task // Evaluator
'Date':Date_Completed_4.SelectedDate}// 'Name': Name_Input_1.Text // Task // Evaluator': Evaluator_Input_Txt_1.Text
This is in a ForAll loop as follows
ForAll(ComboBox_Tasks.SelectedItems,Patch('SPList' , Defaults('SPList') , {'Name': Name_Input_1.Text},{'Evaluator': Evaluator_Input_Txt_1.Text},{'Date':Date_Completed_4.SelectedDate},
This creates 90% of it but I now need the Task Name to be pulled from the combobox and change for each list entry.
"SP List"
Today() // Haze // Task 1 // Evaluator
Today() // Haze // Task 2 // Evaluator
Today() // Haze // Task 3 // Evaluator
Solved! Go to Solution.
So what's the column name and data type of your task column in 'SPList'? If it's just a text column called Task, the code you would use is this.
ForAll(ComboBox_Tasks.SelectedItems,
Patch('SPList' ,
Defaults('SPList') ,
{'Task': TaskName},
{'Name': Name_Input_1.Text},
{'Evaluator': Evaluator_Input_Txt_1.Text},
{'Date':Date_Completed_4.SelectedDate}
)
)
Hi @Haze
Assuming that TaskName is the name of the display column that you use in your combo box, you can just refer to TaskName in your patch function like so:
ForAll(ComboBox_Tasks.SelectedItems,
Patch('SPList' ,
Defaults('SPList') ,
{'Name': Name_Input_1.Text},
{'Evaluator': TaskName},
{'Date':Date_Completed_4.SelectedDate}
)
)
If you're not sure, I would add a label onto your form and type First(Combobox_Tasks.SelectedItems). into the Text property. The IntelliSense in the formula bar should tell you the correct property name to enter after the final dot.
@timl ,
Thanks for responding!
Why is Evaluator tied to the Task Name? I cleaned up my OP to make more sense. The combobox_Tasks.SelectedItems is what I want to use as the changing variable per line.
If Task 1, Task 2, and Task 3 are selected I want the final list to look like
Date // Name // Task 1 // Evaluator
Date // Name // Task 2 // Evaluator
Date // Name // Task 3 // Evaluator
All other inputs are fixed and patch() handles that well but currently I can only get it to repeat the task name not have it different for each record.
I was thinking maybe patch to create then patch to modify?
Apologies @Haze
This is what I was meant to say...
ForAll(ComboBox_Tasks.SelectedItems,
Patch('SPList' ,
Defaults('SPList') ,
{'Name': TaskName},
{'Evaluator': Evaluator_Input_Txt_1.Text},
{'Date':Date_Completed_4.SelectedDate}
)
)
@timl ,
Name is tied to a text input box, not the task name. The task is its own category.
In this example when I press "Update Date of Qualifications" button I want to create 3 list entries.
5/14/20 // Name // Task 213 ... // Evaluator
5/14/20 // Name // Task 217 ... // Evaluator
5/14/20 // Name // CCT710 ... // Evaluator
So what's the column name and data type of your task column in 'SPList'? If it's just a text column called Task, the code you would use is this.
ForAll(ComboBox_Tasks.SelectedItems,
Patch('SPList' ,
Defaults('SPList') ,
{'Task': TaskName},
{'Name': Name_Input_1.Text},
{'Evaluator': Evaluator_Input_Txt_1.Text},
{'Date':Date_Completed_4.SelectedDate}
)
)
User | Count |
---|---|
125 | |
87 | |
84 | |
75 | |
69 |
User | Count |
---|---|
215 | |
178 | |
140 | |
107 | |
83 |