HI @Anonymous ,
Could you please share a bit more about your scenario?
Do you want to patch the amount of items selected in your ListBox control into your Excel table?
Based on the formula that you mentioned, I think there is something wrong with it. The first argument of the Collect() function is required to provide a data source rather than a Column table.
I have made a test on my side, please modify your formula as below:
Collect(
WellnessTracking,
{'Preventive Activities': CountRows(preventiveActivities_listBox.SelectedItems)}
)
In addition, I also think the Patch function could achieve your needs. Please take a try with the following workaround:
Set the OnSelect property of the "Submit" button to following formula:
Patch(
WellnessTracking, /* <-- WellnessTracking represents your Excel table data source */
Defaults(WellnessTracking),
{
'Preventive Activities': CountRows(preventiveActivities_listBox.SelectedItems)
}
)
More details about the Collect function and Patch function, please check the following article:
Collect function
Patch function
Best regards,