Get value of url request parameter to do a test

Hi, I am trying to get a value from the get request params. I found that pm.request.url.query.all() creates an array of objects with the url params. So I tried the following:
let queryParams = pm.request.url.query.all();

So this gets the parameters and when I console log it shows them in object and key / value pairs. Then I need to get a specific value of a property with the following function:

console.log(queryParams.find(function(element) {
    return element.hasOwnProperty("from");

There is a property “from” with value: 2019-08-15. I see it when I console.log the queryParams variable. But when I console.log the above function it returns “null”.

Please advise if I am missing something here.

Thank you,

Hey @nikolay100,

Welcome to the community! :slight_smile:

You could just try something like this:


This worked great. Thanks. Somebody should put this in the documentation, because I could not find it anywhere.