Home › Forums › Pre-purchase Questions › can i preload data from another field? › Reply To: can i preload data from another field?
You would put the code wherever is is that you need to generate this value. It is just a generic example.
If you can edit the code, whether it is for an XML field or for showing the value on the site then you can generate the value in that location in the code as well.
The only reason you would not be able to do this is if you are not working in the code and you’re depending on something else to get the value and that value must be formatted correctly in the DB.
Even if you create the field it is not possible, at least not practically, to retroactively set this value for every product. You would need to do a query to get every single product and then update the field for each product one at a time.
So the question is, are you able to modify the code where you need this value to be used? Or is there some other thing that needs to use this value? Another plugin or setting that you haven’t mentioned?
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!
❓Ever wondered when and why ACF uses JSON instead of the database? Check out our summary of the most recent session of ACF Chat Friday for the answer, and make sure to register for the next session.— Advanced Custom Fields (@wp_acf) February 23, 2023
© 2023 Advanced Custom Fields.