I have a RawJSON field that is editable. And I have another ParsedJSON field that is readonly and should attempt to get a subset of the RawJSON.
I am trying to get the ParsedJSON field to update live (similar to how the slug field in the website template updates live based on the title). I'm wondering if there is a proper/simple way to do this without creating a whole custom component.
I've tried using the beforeValidate hook on the ParsedJSON field which does update the value in the database, but doesn't reflect the change in realtime in the admin panel unless I refresh the page :/ I've been searching the discord/docs (and seen various uses of Field hooks, dispatchFields, etc) but am struggling to pull together the best solution
Yeah there's an open PR for this I think in regards to hooks but I would recommend a custom component with the
useFormFields
hook to accomplish this as of right now:
https://payloadcms.com/docs/admin/hooks#useformfieldsStar
Discord
online
Get dedicated engineering support directly from the Payload team.