Syncing Code Block Data Between Related Collections (A → B)

I have two collections A and B.

Collection B schema has fields like name, description and, importantly, a Code block with some JSON.

Collection A has a many-to-one relationship to B, ie a dropdown where I select one of the items in Collection B and another Code block for JSON.

What I would like is that when the user creates a new object in Collection A, when they select something in the dropdown which references a B item the Code block is, ideally, repopulated with the content of B’s Code block. Or alternatively, we somehow show B Code block in the form.

Makes sense? Note that this cannot really be done with conditionals as there will be hundreds of items in Collection B.