I had a similar requirement for my function. Here you can read how I solved the problem. You can extend dynamic parameters depending on the values of the parameters. Take a look: https://stackoverflow.com/a/79227324/4879264