How to isolate a specific url parameter from my query string | Community
Skip to main content
Level 3
December 13, 2024
Solved

How to isolate a specific url parameter from my query string

  • December 13, 2024
  • 1 reply
  • 656 views

Hi, 
In the mapping of my datastream, I want to isolate the value of a specific url parameter.
Example: from "test=1&account=bitmap&step=abc", I want to map as output the value of account, so 'bitmap' in this case.

 

I did it this way based on this doc and it works:

 

But I have also unwished value if the parameter contains 'account=', not only equals 'account='

Example:

Output should be null because the parameter name is 'IDaccount=' and not 'account='.

Any idea how I can fix this ?

Thanks

 

Robin

 



This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Harveer_SinghGi1

Hi @robinl39529461 ,

You should be able to achieve this by nesting get_url_query_str and map_get_values functions like below,

map_get_values(get_url_query_str("https://example.com?test=1&account=bitmap&step=abc","retain"),"account")

Here are the results for two strings you tested,

 

 

 

1 reply

Harveer_SinghGi1
Community Advisor and Adobe Champion
Harveer_SinghGi1Community Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
December 18, 2024

Hi @robinl39529461 ,

You should be able to achieve this by nesting get_url_query_str and map_get_values functions like below,

map_get_values(get_url_query_str("https://example.com?test=1&account=bitmap&step=abc","retain"),"account")

Here are the results for two strings you tested,

 

 

 

Level 3
January 6, 2025

Thanks a lot for your help. 
It works. Id did it this way using your logic: 
get_url_query_str(get_url_decoded("https://example.com?test=1&account=bitmap&step=abc"),"append")["account"]

Thanks again

 

Robin