# Filter empty values in JSON input

**URL:** <https://community.make.com/t/filter-empty-values-in-json-input/78006>\
**Category:** Questions\
**Tags:** filters\
**Created:** [April 8, 2025, 11:06am UTC](https://community.make.com/t/filter-empty-values-in-json-input/78006 "2025-04-08T11:06:52Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Masa\_Alnomani](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Masa\_Alnomani](https://community.make.com/u/Masa_Alnomani)\
**Post date:** [April 8, 2025, 11:06am UTC](https://community.make.com/t/filter-empty-values-in-json-input/78006/1 "2025-04-08T11:06:52Z")

</div>

Hello,  
I have this json input, and some values might be empty. How can I filter the json so it only contains values that are not empty?

```auto
    {
      "job_position_id": 34534,
      "first_name": "dfd",
      "last_name": "dfd",
      "email": "dfdf",
      "recruiting_channel_id": 34343,
      "application_date": "01.01.2023",
      "phase": {
        "type": "system",
        "id": "343" 
      },
      "files": null,
      "attributes": [
        {
          "id": "custom_attribute_3577048",
          "value": "dfdf"
        },
        {
          "id": "custom_attribute_3577049",
          "value": "dff"
        },
        {
          "id": "custom_attribute_3569071",
          "value": "01.01.2034"
        },
        {
          "id": "custom_attribute_3569072",
          "value": "dfdf"
        },
        {
          "id": "custom_attribute_3569073",
          "value": "01.01.2034"
        },
        {
          "id": "custom_attribute_3569074",
          "value": "23232dff"
        }
      ]
    }

```

thanks in advance.

Best

Masa

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [April 9, 2025, 5:57am UTC](https://community.make.com/t/filter-empty-values-in-json-input/78006/2 "2025-04-09T05:57:27Z")

</div>

Welcome to the Make community!

What do you mean by “some values might be empty”?

---

<div class="post-metadata">

**Author:** ![Masa\_Alnomani](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Masa\_Alnomani](https://community.make.com/u/Masa_Alnomani)\
**Post date:** [April 9, 2025, 9:50am UTC](https://community.make.com/t/filter-empty-values-in-json-input/78006/3 "2025-04-09T09:50:09Z")

</div>

Hey @samliew,  
like for example this value might be null or just empty

```auto
"recruiting_channel_id": null,

```

or

```auto
"recruiting_channel_id": ,

```

In this case I don’t want it to appear in the JSON input so I want to filter it out.

I tried to do that with an if-statement but it is not very helpful becaue some commas might be too much or some might be missing so I was looking for antoher solution.

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [April 10, 2025, 1:08am UTC](https://community.make.com/t/filter-empty-values-in-json-input/78006/4 "2025-04-10T01:08:52Z")

</div>

Welcome to the Make community!

You can use a Text Parser “ **Replace** ” module with this Pattern (regular expression):

```plaintext
\s*"[\w_]+": (?:null|""|\[\s*\]),?(?=\n)

```

**Proof** [https://regex101.com/r/pgXhtB](https://regex101.com/r/pgXhtB/2)

### Important Info

- ⚠ **Global match** must be set to **YES**!

* * *

For more information, see the [Text Parser](https://www.make.com/en/help/tools/text-parser) page in the Make Help Center:

> **Match Pattern**  
> The **Match pattern** module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a [regular expression](https://en.wikipedia.org/wiki/Regular_expression), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.
> 
> - The complete list of metacharacters can be found on the [MDN web docs website](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions).
> - For a tutorial on how to create regular expressions, we recommend the [RegexOne website](https://regexone.com/).
> - For an easy, quick regex generator, try the [Regular Expressions generator](https://regex-generator.olafneumann.org/).
> - For experimenting with regular expressions, we recommend the [regular expressions 101 website](https://regex101.com/). Just make sure to select the **ECMAScript (JavaScript)** flavour in the left panel.

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

P.S.: Investing some effort into the [Make Academy](https://academy.make.com) will save you lots of time and frustration using Make.

---

<div class="post-metadata">

**Author:** ![Masa\_Alnomani](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Masa\_Alnomani](https://community.make.com/u/Masa_Alnomani)\
**Post date:** [April 10, 2025, 10:42am UTC](https://community.make.com/t/filter-empty-values-in-json-input/78006/5 "2025-04-10T10:42:08Z")

</div>

@samliew  
Thanks a lot for you answer.  
I tried it that way, but it didn’t work:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/9/b/9b77f0595f50aadb30e87e220efd3adebe879c51.png)  
Did I do everything correct?

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [April 10, 2025, 11:41am UTC](https://community.make.com/t/filter-empty-values-in-json-input/78006/6 "2025-04-10T11:41:54Z")

</div>

Your pattern did not follow the exact pattern I provided above.

---

<div class="post-metadata">

**Author:** ![Masa\_Alnomani](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Masa\_Alnomani](https://community.make.com/u/Masa_Alnomani)\
**Post date:** [April 10, 2025, 12:42pm UTC](https://community.make.com/t/filter-empty-values-in-json-input/78006/7 "2025-04-10T12:42:01Z")

</div>

Oh, yes my bad 🙂

Now it looks like this:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/5/d/5d8cbae18a0119274aa5d3ab0ede6fe1c05a1031.png)

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [April 10, 2025, 4:56pm UTC](https://community.make.com/t/filter-empty-values-in-json-input/78006/8 "2025-04-10T16:56:09Z")

</div>

You need to put the special variable emptystring in the replace field.

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

---

<div class="post-metadata">

**Author:** ![Masa\_Alnomani](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Masa\_Alnomani](https://community.make.com/u/Masa_Alnomani)\
**Post date:** [April 13, 2025, 2:32pm UTC](https://community.make.com/t/filter-empty-values-in-json-input/78006/9 "2025-04-13T14:32:41Z")

</div>

@samliew, Thank you so much!  
Now, I have an issue with the structure of the `file` value. How can I remove empty arrays inside it?

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/e/6/e6bfe6ba8f6b443440885d9ad4a8be48c3262a74.png)

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [April 22, 2025, 12:34pm UTC](https://community.make.com/t/filter-empty-values-in-json-input/78006/10 "2025-04-22T12:34:17Z")

</div>

No problem, glad I could help!

1. If anyone has a new question in the future, please **start a new thread**. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The [Make Community guidelines](https://community.make.com/t/make-community-the-ultimate-topic/11682) encourages users to try to **mark helpful replies as solutions** to help keep the Community organized.

This marks the topic as solved, so that:

- others can _save time_ when catching up with the latest activity here, and
- allows others to _quickly jump to the solution_ if they come across the same problem

To do this, simply **click the checkbox** at the bottom of the post that answers your question:  
 ![Screenshot_2023-10-04_161049](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/5/d/5d9b26fbef0fd7385a34084f61cd5b9165786f42.png)

3. Don’t forget to like and **bookmark** this topic so you can get back to it easily in future!

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

P.S.: Investing some effort into the [Make Academy](https://academy.make.com) will save you lots of time and frustration using Make.

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [May 6, 2025, 12:46pm UTC](https://community.make.com/t/filter-empty-values-in-json-input/78006/11 "2025-05-06T12:46:43Z")

</div>


