I need to modify JSON data before sending it to an external webhook

:bullseye: What is your goal?

The goal is to receive JSON, modify 1 property, then send it to a webhook.

:thinking: What is the problem & what have you tried?

I’ve tried using built-in function change the data (IF and CONVERT). I’ve tried modifying the data using a variable and then injecting that into the JSON. Nothing seems to work.
This doesn’t appear to work: if(1.sex {{=}} Non-Binary, Gender Fluid, Gender non-conforming, or Gender queer; Non-Binary; 1.sex)
1.sex is the property I am receiving into my JSON object. It’s too long for the out going recipient.

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

Welcome to the Make community!

The equals operator is case-sensitive.

You can try using the replace function with a pattern instead.

{{replace(1.sex; "/^(Non-Binary, Gender Fluid, Gender non-conforming, or Gender queer)$/i"; "Non-Binary")}}
:warning: Make Input Markup:
        Copy-paste the above into the field, including start/end curly brackets for it to import as intended

This replaces an exact match, but not case-sensitive.

Screenshot 2026-02-12 161805

Hope this helps! If you are still having trouble, please provide more details.

@samliew
P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

Thank you for jumping in on my question. Unfortunately that did not work. I copy/pasted the code exactly like you suggested. Initially, the double quotes were automatically removed after copying the code snippet:

so I tried again by manually adding them back like so:

Neither way worked. I’m now going to go down a regex internet rabbit hole to see if I can find alternate solutions. If you have any other ideas I would love to see them! Much appreciated.

Hi Sameliew**,**

Do you have any other ideas by chance? I am at a complete loss.

Thanks,
Dan

That’s correct.

Please provide examples of what you’re trying to match.

Hi @Dan_Hoyal,

Are you still stuck at the same point? Then I may have something for you.

I believe this formula can work for you:

{{switch(1.sex; “Non-Binary, Gender Fluid, Gender non-conforming, or Gender queer”; “Non-Binary”; 1.sex)}}

Attached screenshot for reference

Thank you for the suggestion. Unfortunately, that did not work either.
Here is my implementation:

The data is still sent as “Non-Binary, Gender Fluid, Gender non-conforming, or Gender queer”. Any other suggestions would be greatly appreciated.

Hey Dan,

can you paste the input JSON here so we can see what it looks like?

If you need further assistance, please provide the following:

1. All Relevant Screenshots

We need to see what you’re working with to give you the best advice. Screenshots are important because Make is a visual editor — a picture provides us with more context.

It would help us identify the issue by having screenshots of:

  • relevant module input/output bubbles

3. Properly-formatted Output Bundles from a Scenario Run

Please provide the input/output bundles of each of the relevant modules by running the scenario, or get the bundles from a previous run from the Scenario “History” tab.

Providing the bundles from a scenario run will allow others to replicate what is going on, especially if there are complex data structures (nested arrays and collections) and external services. This helps mapping the correct raw variable names from collections (instead of the label/display name).

Format bundles or JSON with the Code button. See instructions:

View Details ◀

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

A. Upload a Text File

Save each bundle contents in a plain text editor as a moduleNumber-output.txt file. Open the file to check if it has not added additional formatting or encoded the plain text.

  • You can upload files and images to this forum by clicking on the upload button:

    Uploading an attachment here will look like this:
    module1-input.txt (1.2 KB), module1-output.txt (3.4 KB)

B. Insert a Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the bundles AND format them correctly.

:warning: Formatting IS Important! :warning:

Here are some ways to provide text content in a way that it won’t be modified by the forum.

  • Method 1: Type code fence manually
    Manually type three backticks ``` in a separate line before and after the content, like this,

    ```
    text goes here
    ```
    
  • Method 2: Highlight the pasted content, then click the preformatted text/code button

  • Method 3: Upload your file elsewhere and share the public link
    This method is only advised for large files exceeding the forum upload limit.


Sharing these details will make it easier for others to assist you, so that you can get better answers, faster.

@samliew

Thank you again for the help.

Here is my scenario:

Output from the webhook:

‘‘‘

[
    {
        "email": "liz*******@gmail.com",
        "phone": "+1 415-624-4000",
        "full_name": "E**** H******",
        "first_name": "E*****",
        "last_name": "H*****",
        "dob": "1994-01-28",
        "sex": "Non-Binary, Gender Fluid, Gender non-conforming, or Gender queer",
        "age": 32,
        "address": "1954*******",
        "address_2": "",
        "city": "San Francisco",
        "region": "CA",
        "postal_code": "94116",
        "country": "US",
        "confirmation_number": 52088115,
        "transaction_date": "2026-02-01 12:46:07",
        "transaction_date_date": "2026-02-01",
        "transaction_date_time": "12:46:07",

‘‘‘
I’ve obscured some of the information for privacy reasons. The “sex” property is the important bit of course.
Input into the JSON is very interesting in that it doesn’t match the outgoing from the webhook:

‘‘‘[
{
“event_id”: 8160383,
“participants”: [
{
“team”: null,
“sport”: “Full Marathon”,
“gender”: “Non-Binary”,
“last_name”: “H********”,
“birth_date”: “1994-01-28”,
“first_name”: “E********”,
“email_address”: “l********@gmail.com”,
“identifier_number”: “13885”,
“primary_contact_email”: null,
“primary_contact_phone”: “+16268082011”,
“primary_contact_last_name”: null,
“primary_contact_first_name”: “Jocelyn Huey”,
“primary_contact_relationship”: “partner”
}
]
}
]

‘‘‘
As you can see I mapped sex to gender but it is showing as “Non-Binary”.
The output from the JSON object:
’’’

[
    {
        "json": "{\"event_id\":8160383,\"participants\":[{\"team\":null,\"sport\":\"Full Marathon\",\"gender\":\"Non-Binary\",\"last_name\":\"H*******\",\"birth_date\":\"1994-01-28\",\"first_name\":\"E*******\",\"email_address\":\"l********@gmail.com\",\"identifier_number\":\"13885\",\"primary_contact_email\":null,\"primary_contact_phone\":\"+16*******\",\"primary_contact_last_name\":null,\"primary_contact_first_name\":\"J*********\",\"primary_contact_relationship\":\"partner\"}]}"
    }
]

‘‘‘
This is the error in the HTTP Make A Request object:


I’m sending the data to the Google Sheet as an added insight into what is coming from the JSON object. This is what ends up in the google sheet:

image

I’m very confused as to why the JSON in and out data shows “Non-Binary” but the data before and after shows the super long version of the gender.
Thoughts?

Thanks again, you guys are awesome!

Ok so this is showing that the formula is working. And the issue is that whatever you are sending this to is expecting some other value inside the gender field. So where are you sending this data? Check the documentation and the data structure there to see what’s expected.

Also what are you mapping inside the Google sheet?

1 Like

The data that is flowing through the HTTP Make A Request object is going to a 3rd party that I have no control over. According to them, they can only accept “Non-Binary” as the value. I’ve emailed them and am waiting on a response to see if they can provide more insight.

As for the Google Sheet, I’m not mapping anything. I’m just dumping the JSON data in there so I can see what is coming through. The fact that the gender is coming through as the long string is baffling to me given that the input and output of the JSON shows only “Non-Binary”.

I’ll post more info as I get it.

In the mean time, can you share the documentation so we can have a look too?

Also can you show a screenshot of what you have mapped inside the google sheet so we can check why that one is getting the full string as well?