Select options from file based on other selected

It doesn’t seem to be that easy or seemingly only in a hacking way, this is similar: Programmatically change the content of the file field