© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•11mo ago•
5 replies
Arjen

Dynamic ExportColumns based on JSON field in Exporter, possible?

Hi, is it possible to define extra dynamic export columns based on a JSON array from a owner record in a relation manager? My use case: I've got a Course resource with a CourseRegistration (HasMany) relation manager. The Course resource contains a Builder field that is used to insert extra form fields for when people sign up for a course. For example:
[
  {
    "data": {"id": "dN268g", "label": "Question", "data_type": "string", "is_required": true},
    "type": "text_input"
  },
  //...
]
[
  {
    "data": {"id": "dN268g", "label": "Question", "data_type": "string", "is_required": true},
    "type": "text_input"
  },
  //...
]

When a person fills in the sign up form, the extra fields get saved in CourseRegistration in a DB column like so:
{"Question": "Answer", //...}
{"Question": "Answer", //...}

I've added an Exporter to the CourseRegistration relation manager, and I want to create extra columns for every extra form field, so that the csv/xlsx for all signups doesn't contain one column with above data. Is this possible? Is there a way to get a hold of the owner record inside the
public static function getColumns()
public static function getColumns()
method inside an Exporter? Basically I need a way to pass the owner record to the exporter class.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Dynamic columns in exporter
FilamentFFilament / ❓┊help
2y ago
Json Exporter
FilamentFFilament / ❓┊help
2y ago
Exporter: Modify Query based on Options?
FilamentFFilament / ❓┊help
2y ago
Exporter - dynamic generated columns
FilamentFFilament / ❓┊help
10mo ago