Hello,
You could search the forum and docs for any info on repeating panel templates and accessing their parents, also look for how to pass variables between forms, and tags.
There’s also helpful info in this post about reaching around to access variables and forms. There are lots of linked posts there too that may contain issues similar to yours.
I hope this helps in some way