Support

Account

Home Forums Feature Requests Allow conditional logic based on other fields having values.

Helping

Allow conditional logic based on other fields having values.

  • I’ve done a few searches and couldn’t seem to find anything similar to what I’m thinking. Though it was tricky to think what to search for, so perhaps I just didn’t find it.

    At the moment ‘Conditional Logic’ will only allow you to show/hide a field based on the value of a ‘Choice’ type field. I love using this function, but I often find that using any of the 4 choice type fields isn’t appropriate for the situation.

    I’m looking for thoughts on the potential for allowing conditional logic based on any sibling field having a value.

    I’ll simplify a situation that I came across, for an example. Assuming we have a panel on our home page where we want to show off a select few client logos, we would have a repeater with the following sub fields:

      ‘Client’ (Post Object)
      ‘Logo’ (Image)
      ‘Name’ (Text)

    Each individual client post has a post name (the client’s name) and a logo, so if the user selects a post for the ‘Client’ field here we would then want to hide the ‘Logo’ and ‘Name’ fields as we already have access to this content via the selected ‘Client’ post object.

    In this case I would want to configure the following logic for both the ‘Logo’ and ‘Name’ fields:

    “Show this field if [‘Client’][‘is equal to’][‘any value’]”

    I think the options for non-choice field types would be ‘any value’, ‘no value’, ‘default value’.

    Thoughts?

  • Hi @chrisdunnbirch,

    Thanks for the post.

    In this use case I would recommend you explore the option of integrating a set of custom location rules to map the fields when the condition is met.

    Our resource docs have already presented a tutorial on how to tackle this and you can view it here: https://www.advancedcustomfields.com/resources/custom-location-rules/

    I hope this helps.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.