Great that you managed to find the solution yourself. There’s quite a bit of posts like these in the forum and there is also some examples of this in the documentation. Please feel free to mark your own answer as the solution so this topic is closed properly.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users