# Get a value from a webhook header

**URL:** <https://community.make.com/t/get-a-value-from-a-webhook-header/10413>\
**Category:** Questions\
**Tags:** webhooks\
**Created:** [May 11, 2023, 2:07am UTC](https://community.make.com/t/get-a-value-from-a-webhook-header/10413 "2023-05-11T02:07:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juani](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@Juani](https://community.make.com/u/Juani)\
**Post date:** [May 11, 2023, 2:07am UTC](https://community.make.com/t/get-a-value-from-a-webhook-header/10413/1 "2023-05-11T02:07:57Z")

</div>

Hi everyone!

I’m trying to get the value “user-agent” from a webhook header.

 ![Captura de pantalla 2023-05-10 a la(s) 23.05.47](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/1/176a8db4f26015b46d610fa9adb09bee9d879d2e.png)

I was following this example, but I’m not able to get the value:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/7/7bcd22002f9b7216ad3bb91cd9d5706b4972623c.png)

I’m having this error:  
 ![Captura de pantalla 2023-05-10 a la(s) 23.03.26](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/6/67f8d14a1c539125748458e19b4140feb8d8c1ee.png)

This is my function:

{{get(map(HEADERSARRAY; “value”; “name”; “user-agent”); 8)}}

I appreciate any help.  
Thanks!

---

<div class="post-metadata">

**Author:** ![Loopz](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/loopz/32/10120_2.png) [@Loopz](https://community.make.com/u/Loopz)\
**Post date:** [May 11, 2023, 4:54am UTC](https://community.make.com/t/get-a-value-from-a-webhook-header/10413/2 "2023-05-11T04:54:12Z")

</div>

Hi @Juani

You don’t need to add double quotes.  
Also, assuming there’s only one header with name `user-agent`, you’ll be getting an array with just one element, so use the `get` function with param `1` instead of `8`.

Please try this:  
{{get(map(HEADERSARRAY;value;name;user-agent); 1)}}

---

<div class="post-metadata">

**Author:** ![Juani](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@Juani](https://community.make.com/u/Juani)\
**Post date:** [May 11, 2023, 1:35pm UTC](https://community.make.com/t/get-a-value-from-a-webhook-header/10413/3 "2023-05-11T13:35:17Z")

</div>

Hi @Loopz , thank you for your answer.  
Double quotes are just from the copy-paste but they weren’t there in the formula.  
I tried with param 1 instead of 8, same error.

I thought that number was the position in the array. It’s definitely only 1 user-agent per webhook.

As you can see in the first picture, I have an Array of 19 items and each one is a collection.  
Position number 8 of the array contains a collection, that has the name and value that I’m looking for.

I figured it out and I just get that value like this and it works:

 ![Captura de pantalla 2023-05-11 a la(s) 10.20.39](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/6/624268f9aeb6d9a94a31b198a1ee437517722137.jpeg)

Anyway, I would love to know how to make a “search” or “filter” the array and get the value by the name and not by the position of the array…

Thanks

---

<div class="post-metadata">

**Author:** ![Loopz](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/loopz/32/10120_2.png) [@Loopz](https://community.make.com/u/Loopz)\
**Post date:** [May 11, 2023, 2:08pm UTC](https://community.make.com/t/get-a-value-from-a-webhook-header/10413/4 "2023-05-11T14:08:04Z")

</div>

> [@Juani](#):
>
> I tried with param 1 instead of 8, same error.

Do not put a number for the array, as you can’t be sure about the position of that specific header in the list of headers.

Have you tried to extract the user agent with this formula?  
`{{get(map(HEADERSARRAY;value;name;user-agent); 1)}}`

---

<div class="post-metadata">

**Author:** ![Juani](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@Juani](https://community.make.com/u/Juani)\
**Post date:** [May 11, 2023, 2:21pm UTC](https://community.make.com/t/get-a-value-from-a-webhook-header/10413/5 "2023-05-11T14:21:22Z")

</div>

> [@Loopz](#):
>
> `{{get(map(HEADERSARRAY;value;name;user-agent); 1)}}`

Yes, that was I tried to said… I tried your formula with the 1, same error {collection,collection…}.

---

<div class="post-metadata">

**Author:** ![Loopz](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/loopz/32/10120_2.png) [@Loopz](https://community.make.com/u/Loopz)\
**Post date:** [May 11, 2023, 2:26pm UTC](https://community.make.com/t/get-a-value-from-a-webhook-header/10413/6 "2023-05-11T14:26:42Z")

</div>

I’m sorry I missed that.

I’m confused about this:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/6/6e4da8586cdc1f9d8d12fface29d7484f749a210.jpeg)  
A part of the screenshot refers to module 9, which I don’t see on the screenshot

Can you please share additional screenshots:

- 1 from the whole scenario layout
- 1 that shows the error the way it’s displayed in Make without cropping context

---

<div class="post-metadata">

**Author:** ![Juani](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@Juani](https://community.make.com/u/Juani)\
**Post date:** [May 11, 2023, 6:32pm UTC](https://community.make.com/t/get-a-value-from-a-webhook-header/10413/7 "2023-05-11T18:32:18Z")

</div>

“module 1” reference was a screenshot from an example that I was following:  
[https://www.make.com/en/help/tools/webhooks#webhook-headers](https://www.make.com/en/help/tools/webhooks#webhook-headers)

I’m sorry @Loopz, but this actually works:

> [@Loopz](#):
>
> `{{get(map(HEADERSARRAY;value;name;user-agent); 1)}}`

Solution:

 ![Captura de pantalla 2023-05-11 a la(s) 15.30.52](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/e/e16f8d34c229cecb630fc17a552b235881a5ced0.png)

I don’t know why, when I attempted I didn’t realize that was actually working.

Thank you so much!!

---

<div class="post-metadata">

**Author:** ![Loopz](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/loopz/32/10120_2.png) [@Loopz](https://community.make.com/u/Loopz)\
**Post date:** [May 11, 2023, 7:10pm UTC](https://community.make.com/t/get-a-value-from-a-webhook-header/10413/8 "2023-05-11T19:10:38Z")

</div>

You’re welcome! Please mark the answer that helped you as the solution. Thanks!

---

<div class="post-metadata">

**Author:** ![FAQs](https://avatars.discourse-cdn.com/v4/letter/f/eb8c5e/32.png) [@FAQs](https://community.make.com/u/FAQs)\
**Post date:** [May 18, 2023, 11:00pm UTC](https://community.make.com/t/get-a-value-from-a-webhook-header/10413/9 "2023-05-18T23:00:02Z")

</div>


