Using a formula to edit value

hey all! I am getting a URL back from an API request that is structured like this:

https://agenthub.dev/pipeline?run_id=ik8WLEdbz9qsKnDX6yYGWg&agent_id=uc1KtP2CUPvM4mTN1S4Uca

I want to extract just this using a formula: ‘run_id=ik8WLEdbz9qsKnDX6yYGWg’

I am trying to use ‘split’ but can’t get it quite right. Any ideas how I can write a formula just extract the part of the URL starting with ‘run_id’ and ending with ‘GWg’?

let url = new URL(yourString)
return url.searchParams.get('run_id')

thank you!

1 Like