© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
3 replies
MarconiMamba

filling fields based on content of other fields.

I have a textarea where users are expected to paste in some structured XML, I would like to take the attributes of the top level XML Element and set the other fields in the form to these element's values and remove the top level element before it is stored into the database. Is logic and parsing like this possible with vanilla filament? I expect I'll have to use some sort of regex unless XML parsing is possible at runtime like this.
Solution
The Filament part would be using

->live()
->afterStateUpdated(fn (Set $set) => parse and set fields)
->live()
->afterStateUpdated(fn (Set $set) => parse and set fields)


PHP should come with SimpleXML extension by default which you could use: https://www.php.net/manual/de/book.simplexml.php
Jump to solution
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

RichEditor: Dynamic mergeTags based on other fields value
FilamentFFilament / ❓┊help
4mo ago
Form field value based on 2 other fields
FilamentFFilament / ❓┊help
13mo ago
Dynamic form fields based on dependant fields
FilamentFFilament / ❓┊help
3y ago
Make a toggle required based on the other 3 fields
FilamentFFilament / ❓┊help
3y ago