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

**URL:** <https://community.directus.com/t/syncing-code-block-data-between-related-collections-a-b/2191>\
**Category:** General\
**Tags:** data-modeling\
**Created:** [April 27, 2026, 1:39pm UTC](https://community.directus.com/t/syncing-code-block-data-between-related-collections-a-b/2191 "2026-04-27T13:39:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![arismarko](https://sea2.discourse-cdn.com/flex002/user_avatar/community.directus.com/arismarko/32/650_2.png) [@arismarko](https://community.directus.com/u/arismarko)\
**Post date:** [April 27, 2026, 1:39pm UTC](https://community.directus.com/t/syncing-code-block-data-between-related-collections-a-b/2191/1 "2026-04-27T13:39:50Z")

</div>

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.
