Programmaticaly update an array field via a Custom Component #11797
immotus
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a collection with an
upload
field that hashasMany: true
, like so:The
GalleryLabel.tsx
has a link button that is meant to fetch some data from an API and populate this field:The Auto-retrieve button, once clicked, shows the current value alright, but any attempt to
setValue
doesn't bring any luck. The most obvious and logical way would be just to use the providedsetValue
callback function, e.g.,I didn't have any luck with the
addFieldRow
function, and a much more straightforwardremoveFieldRow
doesn't behave as expected, e.g., the following code, instead of removing just the first item from the array, clears up the whole field (at least visually):So the question is, is it even possible to update array, relationship, or any other fields with
hasMany: true
programmatically?Beta Was this translation helpful? Give feedback.
All reactions