It’s very easy to query SQL table-valued function to retrieve the result with Dataflows.
This is how we do this.
Let’s connect to a database. It will work via gateway as well.
Select your function.
Pass the parameter if required.
Now you can use this table to merge with other tables or map and load to Dataverse.