Home › Forums › ACF PRO › How to auto-populate a field getting values from other fields? › Reply To: How to auto-populate a field getting values from other fields?
You’re trying to set the default value. The default value is only used on new posts. When this is first run on a new post, both of the other fields will have no value so you’re setting the default value to nothing. After the post is saved the first time the default value is ignored.
If you want this field set based on the other fields then I would suggest an acf/save_post action that updates this field when the post is saved, https://www.advancedcustomfields.com/resources/acf-save_post/, https://www.advancedcustomfields.com/resources/update_field/
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.