Here I have to submit and store value in ListBox to multiple line in SharePoint. I found a code in this post Save multiple items from a combobox in to excelfile with Powerapps.
And here is my code
ForAll(
Split(
Concat(ListBox1.SelectedItems,EmployeeCode,","),",");
Collect(boxCol,Result);
Patch(ProjAs,DS(ProjAs),
{ProjectName:Dropdown2.Selected.ContractProject,
EmployeeCode:Result,
StartDate:DatePicker1.SelectedDate,
EndDate:DatePicker1_1.StectedDate}
)
);
Can you figure out where did I wrong.
Thank you very much.
Solved! Go to Solution.
When I was trying with Collect it was giving me error in ForAll function, you can use Collect like this -
ForAll(
Split(
Concat(ListBox1.SelectedItems,EmployeeCode,","),","),
Collect(boxCol,Result));
After Collect use the below formula -
ForAll(
Split(
Concat(ListBox1.SelectedItems,EmployeeCode,","),","),
Patch(ProjAs,DS(ProjAs),
{ProjectName:Dropdown2.Selected.ContractProject,
EmployeeCode:Result,
StartDate:DatePicker1.SelectedDate,
EndDate:DatePicker1_1.StectedDate}
)
);
Please try using below formula :
ForAll(
Split(
Concat(ListBox1.SelectedItems,EmployeeCode,","),","),
Patch(ProjAs,DS(ProjAs),
{ProjectName:Dropdown2.Selected.ContractProject,
EmployeeCode:Result,
StartDate:DatePicker1.SelectedDate,
EndDate:DatePicker1_1.StectedDate}
)
);
Can you explain why need to remove the Collect(), I think we need for the get store temp data from ListBox. Then use it as "Result" below.
Thank you for your reply
When I was trying with Collect it was giving me error in ForAll function, you can use Collect like this -
ForAll(
Split(
Concat(ListBox1.SelectedItems,EmployeeCode,","),","),
Collect(boxCol,Result));
After Collect use the below formula -
ForAll(
Split(
Concat(ListBox1.SelectedItems,EmployeeCode,","),","),
Patch(ProjAs,DS(ProjAs),
{ProjectName:Dropdown2.Selected.ContractProject,
EmployeeCode:Result,
StartDate:DatePicker1.SelectedDate,
EndDate:DatePicker1_1.StectedDate}
)
);
Thank you its work for me now
User | Count |
---|---|
126 | |
87 | |
85 | |
75 | |
69 |
User | Count |
---|---|
215 | |
180 | |
139 | |
97 | |
83 |