Change URL varible to another value before sending to webhook

Is it possible to get a value from the URL and change it to another value in a hidden field?

Example campaign URL with a Unbounce form:
The URL variable ‘source=345’ correspondence with an ID variable (ex. ‘Ef45RfghtTY67HFD’) in another system which I’m sending data to trough a webhook.

So when I recieve the varible ‘source=345’ from the URL in my Unbounce form I need it to change that value to ‘Ef45RfghtTY67HFD’ and place than value to a hidden field called ‘leadsource_id’ before it get send through the webhook.

source=345 -> leadsource_id=Ef45RfghtTY67HFD
source=301 -> leadsource_id=Gb65Gf345Rfgt3Ed
source=22 -> leadsource_id=bHN54Defr456REF
…and so on.

Is that possible?

Thanks in advance

Found a solution:

Ex. page with Unbounce form:

<script type="text/javascript"> 
function getParameterByName(name, url) {
    if (!url) url = window.location.href;
    name = name.replace(/[\[\]]/g, '\\$&');
    var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
        results = regex.exec(url);
    if (!results) return null;
    if (!results[2]) return '';
    return decodeURIComponent(results[2].replace(/\+/g, ' '));
var URLsource = getParameterByName('source');  

if(URLsource == 516)
else if(URLsource == 229)
else if(URLsource == 119)