I'm developing a custom report using the table api from here https://docs.moodle.org/dev/lib/tablelib.php
I have added a form with a filter that has among other things, checkboxes to add columns of custom user profile field data to the table.
All filters are working, and the extra columns are getting added to the table on the page, however, those extra columns are not being downloaded. I have tried getting the extra column options as an optional parameter on the page and from the form data, but it seems that if it is an added column from those options, then it does not go to the download. If I hardcode my extra columns rather than get them from the parameters or form data then they do download--so getting them as options from the filter form seems to be the issue.
Any ideas as to how I can get the extra columns to go to the download would be greatly appreciated.
Thanks