There is a domain specific language for your problem: https://docs.askalot.io/guide/qml-syntax/ Questionnaire Markup Language (QML)