Finding a specific header value

Hello all!

I have a formula that is getting the value from a specific header in our payload:

{{get(map(27.headers; “value”); 8))}

My formula has the header position hardcoded (at the moment, our vendor sends the data to our webhook and the header is 8), but that could change.

Any suggestion on modifying this formula so it searches for a specific header value based on its NAME?

Is this as simple as:

{{get(map(27.headers; “value”;“headername”); 1))} ??

Thank you!

Please provide the output bundles of the module by running the scenario, then click the white speech bubble on the top-right of each module, save the bundle contents in your text editor as a bundle.json file, and upload it here into this discussion thread.
Screenshot_2023-10-06_141025

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

2 Likes

Here is the JSON output of the Iterator
headeroutput.json (1.9 KB)

Sorry for the delay, I was out travelling over the weekend :slight_smile:

There is actually a very simple solution to this:

Screenshot_2023-12-18_201221

This way you can map the header values by name in a later module:

Screenshot_2023-12-18_201246 (2)

That’s perfect! Will I need to use a map function afterwards or a get? (or both) to retrieve the value I want?

I’m using this formula to parse the data I need out of that field:
image
with this formula to get the header currently:
image

Nevermind - answered my own question!

{{get(toCollection(27.headers; “name”; “value”); “content-disposition”)}}

Works like a charm! Thank you!

1 Like