Hi there,
You can hook into the acf/save_post hook that is called when the form is submitted and create this logic.
Please take a look at the examples on this page: https://www.advancedcustomfields.com/resources/acf-save_post/
I hope this info helps.