The dynamic options example referenced in this blog post. It looks at how the getOptions() method can be used and how a dynamic approach can result in populating options lists on the fly. This simple example uses countries and towns and uses a simple JSON object in the code, so you can see easily how it is populated. Once you have understood this mechanism, you will be well placed to build your own more sophisticated dynamic options.
If you are interested in the topic, here are two other examples of more complex usage in the shop / with accompanying articles listed in the product description (there are several others in our article library) :
Dynamic List of Values