Cast to ObjectId failed for value

default discord avatar
last month

I get this error when I try to open the relationship field after I added data there programmatically.


1. I added a new row to the array using dispatchField (Screenshot 1)

2. The ID is successfully passed to the row (Screenshot 2)

3. Payload successfully receives data by id (Screenshot 3)

4. I am trying to edit the relationship field manually and get an error Cast to ObjectId failed for value. I see that the id is not transmitted when the payload tries to load the data of other items (Screenshot 4)

5. This is what the relationship field looks like (Screenshot 5)

The problem was solved by switching to version 1.12.0 using a new method for working with arrays.

    Open the post
    Continue the discussion in Discord
    Like what we're doing?
    Star us on GitHub!


    Connect with the Payload Community on Discord



    Can't find what you're looking for?

    Get help straight from the Payload team with an Enterprise License.