#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)

trail sundial
#

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

bright foxBOT
trail sundial
#

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)

trail sundial
#

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.