What's the best way to add custom fields to a form that's being exported?

Thanks @cyberdave I’ve got it working. This post is a bit old now but it says only first name, last name and email will work and that other fields will be ignored: