Hi Prausa,
This is one of the most common questions here. Many years ago we created a data-source-independent common library called qRules so that we could stop answering every specific coding request. I recommend downloading the free trial here and using the Insert command. It's very easy. See my attached example as well.
One note: you don't want a repeating field. Instead, add a group node with a repeating group underneath it (child) and non-repeating fields underneath that. That's the best practice. Long story why, but trust me that's what you want.