# Cannot get value from $queryParams key if key name contains dot(.)

**URL:** <https://community.postman.com/t/cannot-get-value-from-queryparams-key-if-key-name-contains-dot/43285>\
**Category:** Help Hub\
**Tags:** mockservers, mock-server\
**Created:** [January 27, 2023, 7:36am UTC](https://community.postman.com/t/cannot-get-value-from-queryparams-key-if-key-name-contains-dot/43285 "2023-01-27T07:36:06Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![webworm00](https://avatars.discourse-cdn.com/v4/letter/w/7cd45c/32.png) [@webworm00](https://community.postman.com/u/webworm00)\
**Post date:** [January 27, 2023, 7:36am UTC](https://community.postman.com/t/cannot-get-value-from-queryparams-key-if-key-name-contains-dot/43285/1 "2023-01-27T07:36:06Z")

</div>

> **Archived topic — some details may be out of date.**  
> Mock servers built from saved collection examples are still supported. Postman now also has **code-based mocks** : JavaScript request handlers plus a `config.yaml`, stored as files in your Git repository, which you can run locally or deploy. Create one in the app, or use the Postman CLI to generate one from an OpenAPI spec, collection or dataset (`postman mock generate`) and run it (`postman mock run`). See [About mocks](https://learning.postman.com/docs/design-apis/mock-apis/mocks/overview) and [Create a mock](https://learning.postman.com/docs/design-apis/mock-apis/mocks/create-a-mock).  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) can build and run mocks for you.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

I’m trying to test Meta APIs on Postman mock servers. I tried to create a contextual response using the $queryParams template helpers to an example in my mocked collection as shown [here](https://learning.postman.com/docs/designing-and-developing-your-api/mocking-data/creating-dynamic-responses/).

It works when my query string key is simple text containing only alphabets. However, if my key has a dot (.) in it, it does not seem to work e.g. “hub.challenge”:

[https://xxxx.mock.pstmn.io/hook?hub.challenge=123123123](https://xxxx.mock.pstmn.io/hook?hub.challenge=123123123)

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/a/d/ad6c5f2c59b85e0b37f1749c86ddc34cf5df3d29.png)

According to the docs, it seems to be able to use the \ character to escape the dot(.):

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/8/1/8131fe201bcc062c1db3463bafc0b69b8dfcfebf.png)

However, when I try it out, the response is blank:

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/f/7/f7bec594f4c24413d29a955b7d8a911791f83500.png)

I’ve already tried using “hub\.challenge” and “hub.challenge” in the contextual response template but none works. If I change the key to something like “hubchallenge” instead of “hub.challenge”, then it works properly.

Does anyone have any idea or solution to this? Thanks.

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [January 27, 2023, 9:54am UTC](https://community.postman.com/t/cannot-get-value-from-queryparams-key-if-key-name-contains-dot/43285/2 "2023-01-27T09:54:25Z")

</div>

Hi @webworm00

Try removing the double quotes.

```auto
{
    {{$queryParams 'hub\.challenge'}}
}

```

The quotes pass the text as a string but if you see the examples on the page you linked they are without quotes.

---

<div class="post-metadata">

**Author:** ![webworm00](https://avatars.discourse-cdn.com/v4/letter/w/7cd45c/32.png) [@webworm00](https://community.postman.com/u/webworm00)\
**Post date:** [January 28, 2023, 1:22am UTC](https://community.postman.com/t/cannot-get-value-from-queryparams-key-if-key-name-contains-dot/43285/3 "2023-01-28T01:22:24Z")

</div>

Hi, if I remove the double quotes, it simply returns blank:

![image](https://us1.discourse-cdn.com/getpostman/original/3X/b/f/bf0658099381af30f6706917fd7c07ff5bda4870.png)

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [January 28, 2023, 1:00pm UTC](https://community.postman.com/t/cannot-get-value-from-queryparams-key-if-key-name-contains-dot/43285/4 "2023-01-28T13:00:52Z")

</div>

Try removing the back slash. A dot shouldn’t need to be escaped in URL encoding as far as I am aware.

If that doesn’t work I’ll set up a mock and have a play around with it

---

<div class="post-metadata">

**Author:** ![webworm00](https://avatars.discourse-cdn.com/v4/letter/w/7cd45c/32.png) [@webworm00](https://community.postman.com/u/webworm00)\
**Post date:** [January 28, 2023, 2:06pm UTC](https://community.postman.com/t/cannot-get-value-from-queryparams-key-if-key-name-contains-dot/43285/5 "2023-01-28T14:06:11Z")

</div>

Tried  
{{$queryParams ‘hub.challenge’}}  
{{$queryParams ‘hub\.challenge’}}  
{{$queryParams ‘hub\\.challenge’}}

All of them returns blank  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/9/b/9b24bd09c27123a0c5270714e2c810dbc8af045e.png)

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [January 28, 2023, 2:14pm UTC](https://community.postman.com/t/cannot-get-value-from-queryparams-key-if-key-name-contains-dot/43285/6 "2023-01-28T14:14:35Z")

</div>

I’ve been playing with this for the last hour to no avail.

The stub itself is working, as I added another element which returns.

Therefore the . in the parameter is being recognised.

I’ve tried all variations of escape characters including URL encoding ($2e, %2e, etc).

In the end, out of desperation, I created a collectionVariable called Param and used that in the Example.

```auto
{
    "{{$queryParams {{param}}}}"
}

```

This does something really strange as it is finding the parameter but its wrapping it in an object, instead of just showing the value.

```auto
{
    "{"hub.challenge":"1234567"}"
}

```

So close, but yet so far.

I guess all I can really say is that I can confirm that having the . is causing a problem.

I’m off to play the Xbox. Have a good weekend.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [January 28, 2023, 2:17pm UTC](https://community.postman.com/t/cannot-get-value-from-queryparams-key-if-key-name-contains-dot/43285/7 "2023-01-28T14:17:43Z")

</div>

Amending the example to just include the following.

```auto
{{$queryParams {{param}}}}

```

Now produces a single json object in the response (removing the extraneous quotes)  
Still not just the value as you would expect though.

```auto
{
    "hub.challenge": "1234567"
}

```

If you change the value of hub.challenge, it is returning the updated value.

Not sure if that is acceptable.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [January 28, 2023, 2:46pm UTC](https://community.postman.com/t/cannot-get-value-from-queryparams-key-if-key-name-contains-dot/43285/8 "2023-01-28T14:46:24Z")

</div>

Scrub that last bit, as I’ve just realised that this is basically ignoring the param.

It needs to be a valid variable, but is basically being ignored.

It’s basically like calling $queryParams without any arguments or with empty quotes.

You’ll get the same results. It returns all of the params in the mock as an object (which may be a work around).

The stub itself works, with the dots in.

It’s just the $queryParams in the mock doesn’t seem to be able to handle the dots when trying to return a specific parameter.

The common solution to using escape characters doesn’t seem to be supported.

Might be a bug that should be raised on the Postman Github.

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [January 28, 2023, 8:34pm UTC](https://community.postman.com/t/cannot-get-value-from-queryparams-key-if-key-name-contains-dot/43285/9 "2023-01-28T20:34:14Z")

</div>

Have raised this as a bug on Postman GitHub:

> <https://github.com/postmanlabs/postman-app-support/issues/11667>
>
> \### Is there an existing issue for this?
> 
> \- \[X\] I have searched the tracker for …existing similar issues and I know that duplicates will be closed
> 
> \### Describe the Issue
> 
> The instructions for \[Generating contextual mock responses\](https://learning.postman.com/docs/designing-and-developing-your-api/mocking-data/creating-dynamic-responses/) suggest that you can "Return the value of the property a.a which has a dot (.) in the key name" by using a backslash like this, "{{$body 'a\\\\.a'}}".
> 
> However, if there is a dot(.) present, for example, \_"hub.challenge": 123123123\_ then the back slash does not work to escape the character and no value is displayed. 
> 
> Original discussion here:
> https://community.postman.com/t/cannot-get-value-from-queryparams-key-if-key-name-contains-dot/43285
> 
> Example not working:
> Mock server example:
> !\[image\](https://user-images.githubusercontent.com/86320001/215289306-a769ad14-6e0e-45e7-a5ae-3f91d8b7f433.png)
> 
> No param displayed when called:
> !\[image\](https://user-images.githubusercontent.com/86320001/215289297-af3d6591-08d4-41f6-b57a-f0dd69ca0562.png)
> 
> Exmaple working if dot(.) is removed:
> Mock server example:
> !\[image\](https://user-images.githubusercontent.com/86320001/215289337-211206c5-fc3c-4dde-acf5-21f08f3bd230.png)
> 
> Param displayed when called:
> !\[image\](https://user-images.githubusercontent.com/86320001/215289350-bf503adb-6be0-4d93-bce8-882822f5ca0d.png)
> 
> 
> \### Steps To Reproduce
> 
> 1. create a mock with query param with a dot(.) eg. "hub.chellenge"
> 2. try to get the param by using the example provided in Postman docs: "{{$queryParams 'hub.challenge'}}"
> 3. no value is passed
> 4. add a backslash \\\\ before the dot(.) as per instructions
> 5. still no value displayed
> 6. Remove the dot(.)
> 7. value is then passed 
> 
> \### Screenshots or Videos
> 
> \_No response\_
> 
> \### Operating System
> 
> Windows
> 
> \### Postman Version
> 
> 10.8.7
> 
> \### Postman Platform
> 
> Both
> 
> \### User Account Type
> 
> Signed In User
> 
> \### Additional Context?
> 
> \_No response\_

---

<div class="post-metadata">

**Author:** ![telecoms-candidate-6](https://avatars.discourse-cdn.com/v4/letter/t/f475e1/32.png) [@telecoms-candidate-6](https://community.postman.com/u/telecoms-candidate-6)\
**Post date:** [February 14, 2023, 10:32pm UTC](https://community.postman.com/t/cannot-get-value-from-queryparams-key-if-key-name-contains-dot/43285/10 "2023-02-14T22:32:37Z")

</div>

I was just trying to do the exact same thing with Facebook webhook setup and ran into the same problem. After a couple hours of fighting with it, I stumbled on to this thread. Very frustrating to get stuck at step 1 of testing out some web hooks. Not sure if I’m more bothered by the fact that Facebook decided to include a ‘.’ in the query params, or that postman couldn’t handle it properly 😀

I didn’t see a way to +1 the issue that was opened on Github, but would gladly do something there if it would get more attention on this one.

---

<div class="post-metadata">

**Author:** ![webworm00](https://avatars.discourse-cdn.com/v4/letter/w/7cd45c/32.png) [@webworm00](https://community.postman.com/u/webworm00)\
**Post date:** [February 15, 2023, 7:45am UTC](https://community.postman.com/t/cannot-get-value-from-queryparams-key-if-key-name-contains-dot/43285/11 "2023-02-15T07:45:58Z")

</div>

Personally I moved to using pipedream to test the webhooks since I do not know when or if it will be resolved.
