Home › Forums › General Issues › Import data from CSV, sort and add the data into rows of a repeater field. › Reply To: Import data from CSV, sort and add the data into rows of a repeater field.
I can’t say I’ve ever seen any documentation on this.
I thought you were looking for information on everything from parsing the CSV to how to store the data.
Sorting the repeater fields.
I would create an acf/save_post hook that runs after ACF is done. I would then extract all of the data from the repeater field into and array and then insert it all back into the repeater field in the order that I wanted. I think this might be the only way.
Making sure it was imported only once, basically you’d need to delete all of the data currently in the repeater before importing so that the import overwrites everything that’s already in there. Either that or you have to perform a check on every field and the content in the field to see if it already exists before insertion. Most import tools go with the “Delete everything and then reinsert” model.
If you’ve been looking at storing data for acf repeater fields then you already know that it is a complex issue.
Like I said above, I don’t know of much information on doing any of this, what I’ve figured out was basically by digging through the database and the acf code to figure out how it works.
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.