Filtering based on IP address of Webhook

I’m building a scenario to process data from a few different lead capture points on our website. I’m leveraging a single webhook, and have things flowing well.

Where I’m struggling is that I’d like to filter the processing based on the IP address of the server calling the webhook. My goal is to be able to have the scenario have a separate path for traffic from our staging instance, allowing data from our production instance to run through the whole process.

As a test, I’m trying to include the IP address as part of data I’m adding to a Google Sheet, before attempting to set up a filter using it. Reading elsewhere, I’ve compiled this:

get(map(2.__IMTHEADERS__; “value”; “name”; “cf-connecting-ip”); 1)

Which is returning nothing in the cell in the spreadsheet.

However, this:

2.__IMTHEADERS__[12].value

Correctly gives the IP address.

I’d much rather trigger off the “cf-connecting-ip” as relying on it always being element 12 is a rather brittle solution.

Can anybody point out what I’m doing wrong with the get/map process here?

Thanks in advance!

Welcome to the Make community!

You have not yet provided sufficient information to allow identification of the issue.

To allow others to assist you with your scenario, please provide the following:

1. Relevant Screenshots

Could you please share screenshots of your full scenario? Also include screenshots of any error messages, module settings (fields), relevant filter settings (conditions), and module output bundles. We need to see what you’re working with to give you the best advice.

You can upload images here using the Upload icon in the text editor:

2. Output Bundles of Modules

Please provide example output bundles of the trigger module by running the scenario (you can also get this without re-running your scenario from the History tab).

Click on the white speech bubbles on the top-right of each module and select “Download input/output bundles”.

A. Upload as a Text File

Save each bundle contents in a plain text editor (without formatting) as a bundle.txt file.

You can upload the file here by clicking on this button:

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

Providing the input/output bundles will allow others to replicate what is going on in the scenario, especially if there are complex data structures (nested arrays and collections) or if external services are involved.

Sharing these details will make it easier for others to assist you.