Conditional custom field

default discord avatar
last year
1 1

Hi, I was wondering if it's possible to add conditional display to a custom field. When you create a field with a condition, it's possible to acces that condition within the field. However that field doesn't have access to data or siblingData. Is there a where to apply the condition to a custom field?

Blog reference:

  • discord user avatar
    Payload Team
    last year

    Hey @edblocker it sure is!

    We've just released a beta (0.11.2-beta.0) that now exports Payload's internal withCondition. We've also updated the field docs to call out to how this all works, but that will not be published on our site until we deploy a new minor version. So for now you can read about it right on GitHub.

    Give it a shot - I'd like to hear what you think!

    1 reply
  • default discord avatar
    last year

    That is exactly what I'm looking for. I'll wait for the next release to integrate this in my project, thank you.

Open the post
Continue the discussion in GitHub
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.