Support

Account

Home Forums General Issues If field contain a specific value, update value in another field

Helping

If field contain a specific value, update value in another field

  • Hi 🙂

    As I wrote in the title, is it possible to change the value of a field based on the value of another field programatically?

    This other field has already a value but I need to replace / update it.

    To be more precise:

    If the Text Field named type as the value of Houses AND another Text Field named “service” has value 2, this should be updated in NOT AVAILABLE.

    If the Text Field named type as a value of Parks AND another Text Field named “service” has value 2, this should be updated in AVAILABLE.

    I read the update_field doc but I could not solve this.

  • You need to create an acf/save_post action with a priority > 10.

    In this action get the values of the other 2 fields, apply logic and update the value of the 3rd field. Make sure you include the value of $post_id when getting and updating the fields.

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

You must be logged in to reply to this topic.