F
Filament2mo ago
Yohan

Exporter Importer on JSON model fields

I need to be able to export and import data from my model. To do this, I use Filament's Import and Export functions. My problem is that my model has a field called variables_form which contains a JSON that can vary from one model to another. And I'd like to generate a different column in my CSV export for each of the json keys contained in this field. Example: {"59": "Move and store your furniture, without moving from your home", "60": "Need to store your furniture during construction? We'll collect and store it for you! Order redelivery from your cell phone with us.", "61": "Best box"} I'd like this JSON to generate 3 different columns in my CSV. I've seen that columns can be managed using the public static function getColumns(): array method, but I can't generate my columns dynamically here, as I don't have access to the Model (which is necessary in my case to know how the variables_form field is made up). So the question is quite simple, how to handle this case with the export feature ?
0 Replies
No replies yetBe the first to reply to this messageJoin