You cannot put a variable in a data_connection definition, you could create as many data_connections as needed and use a variable when calling the data_connection but it could be a lot of data_connections to define !
I know a way, maybe there are better ones but still ==> you can do this by disabling the "standard mode" on qlik sense server.
It means you will not have to use data_connections any more (but you will still be able to) and ou will be able to use (as in qlikview) relative and network paths to call sources (so even web sources), directly from the script.
Something as : LOAD * FROM D:/Data_Folder/Etc. or FROM [https://website.com/Etc_Etc]
There is an issue then : anyone that can create an app will be able to call network paths sources that are available from the qlik sense server.
So it's up to you and your securty policy, maybe there is a way to not aload the qlik sense service user to access some paths, but I am not sure.
Thomas Le Gall