Handling static fields in the ImportAction feature.
Hello , i have case where I want to import units for a particular block.The blocks are already in the db , is there a way to make a select in the importaction for blocks field and do something like
6 Replies
Any insights here?
What is the relation between the units and the blocks? Take a look at https://filamentphp.com/docs/3.x/actions/prebuilt-actions/import#using-import-options, replace the checkbox with your select and in the resolveRecord function set the value when instantiating the model.
One block can have several units .One to many.
Well, the answer still stands. Let me know if you need help.
Got something of the sort above ...Though it feels weird having that outside the columns yet it's one of the columns.
But is it part of the import file? Now I’m confused… Obviously you can also make it one of the import columns but then the user should include it in the import file. As IDs are not very user friendly you can ask for a name and then find the matching ID on the backend (mutating the data).