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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Remove null Values fro...
Power Automate
Unanswered

Remove null Values from type object

(0) ShareShare
ReportReport
Posted on 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,441 Super User 2025 Season 2 on at
     
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard