example usage
I have a certificate copy upload field and it is relation to document slugs collection,
in my document slugs collection it have other field like application profile id , document type id,
i would like to prefill the value when a modal open the child form (other collection form) when a custom component button is clicked
#Is there a way to access child field from parent form so that i can set the value?
1 messages · Page 1 of 1 (latest)
Help is on the way! To mark it as solved, use the /solve command. In the meantime, here are some existing threads that may help you:
Documentation:
- React Hooks - useAllFormFields - Updating other fields' values
- React Hooks - useField
- Radio Group Field
- The Payload Config - Compatibility flags
- Lexical Migration - Migrating lexical data from old version to new version
Community-Help:
currently what i can think of is using context provider and on the field pick up the value being set by the custom component (not ideal)
another way to set the value in localstorage and the child field just pick the value (also not ideal)
is there official way of doing it like useField hooks, i check the useFormFields it doesn't contain any field that render from modal (child form)
found a better way, just setup a virtual field, stringify object value into the virtual field, then in the child form, useEditDepth to check whether the form is not in root form, if so find the virtual fieldname and get the value.