Using json files to compose UI schema

Hi!

I’m developing a dynamic input form that will adjust when the user selects the lists of fields we have in the form. For this I have N json schema which I have read properly and the selected answers are populated.

My question is, I only have 1 collection for the form, if I fetch the collection with new values I will lost the others one. I have the $ref (refereneces) on json files.

Is there anyway to do this without javascript?

Whats is the best approach?

Thanks!