How to make a datasource parameter dependent on a script parameter?

I want the value that a script parameter returns to be an input for a datasource parameter, but I can’t make it work.

Can I configure the return type of the script parameter to be an integer?

This question is a follow up to the one I asked on the following link.

https://forum.reportserver.net/viewtopic.php?id=775

The idea is that text parameter will pass it’s value to script parameter and then script parameter will pass its own value to database parameter.