web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : yg/nr5wJnnmQkp3JU3Hzp1
Power Automate - General Discussion
Unanswered

Remove null Values from type object

Like (0) ShareShare
ReportReport
Posted on 8 Jul 2025 06:55:44 by

Hi,
I have a JSON object with multiple key-value pairs, and I want to remove all keys with empty string ('') values.

Example:

Input:

 
{
  "Key1": "value1",
  "Key2": "value2",
  "Key3": ""
}
 

Expected Output:

 
{
  "Key1": "value1",
  "Key2": "value2"
}
 

How can I achieve this with Power Automate?

Categories:
I have the same question (0)
  • Chriddle Profile Picture
    8,030 Super User 2025 Season 2 on 08 Jul 2025 at 08:12:49
    Remove null Values from type object
     
    2. If there are only a few properties, chain this approach:
     
     
    if(
    	empty(
    		outputs('Compose')?['Key3']
    	),
    	removeProperty(
    		outputs('Compose'),
    		'Key3'
    	),
    	outputs('Compose')
    )
     
     
    3. If there are a lot of possible empty properties, this approach uses less actions:
     
     
    Select
    From: all the property names
    Map:
    if(
    	empty(
    		outputs('Compose')?[item()]
    	),
    	removeProperty(
    		outputs('Compose'),
    		item()
    	),
    	outputs('Compose')
    )
     
    Compose 3
    an intersection of all the items from the Select
    intersection(
    	body('Select')[0],
    	body('Select')[1],
    	body('Select')[2]
    )
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 954 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 650 Moderator

#3
trice602 Profile Picture

trice602 327 Super User 2025 Season 2

Last 30 days Overall leaderboard