Filament Action: Select field shows ID instead of name when filling form
Hi everyone,
I have a Filament Action that opens a form with a Select field for choosing an instructor.
The issue is:
When the action is opened, the instructor select field shows the instructor’s ID instead of their name.
Here’s the situation:
My fillForm() method sets the value using the instructor’s id.
The select displays the raw id in the input, not the instructor name.
If I change fillForm() to use the instructor name, it shows correctly, but then I get a validation or saving error saying it “only accepts IDs.”
What’s the correct way to make the select field display the instructor’s name but still store the ID when submitting?
3 Replies

Maybe something similar to
->relationship('month', 'name') ?
month - relation
name - which field to be shown on dropdownDoes that prefilled instructor actually exist in your dataset?
Or does your
modifyQueryUsing maybe remove it from the dataset?