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 / Replacing null values ...
Power Automate
Unanswered

Replacing null values using Compose

(0) ShareShare
ReportReport
Posted on by 15

I have data coming in from SQL Server that has some null values which I want to replace.

 

In this example I have 3 rows of data, 2 rows have a null value and one has my email address.

 

The Select step is obtaining this data 

Output:

 

null,

null,

emsss@example.com

 

Compose 2 step is me trying to replace the null values with the following expression

 

if(equals(body('Select'), null), 'emsss@example.com', body('Select'))
 
Output:

null,

null,

emsss@example.com

 

Compose step is trying to make sure there's no repeats of same value in this case output:

 

null,

emsss@example.com

 

What I want to see is just my email and no null values. Ideal output:

emsss@example.com

 

Can anyone help with this?

 

Categories:
I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @EMSSS 

     

    I think you can use filter action in power automate.

     

    Could you show how output from sql looks in power automate, i meant json structure ?

     

  • EMSSS Profile Picture
    15 on at

    I'm using SQL Get Rows V2. Connected to my database and table.

     

     

  • EMSSS Profile Picture
    15 on at

    Why doesn't this expression work in replacing null values

     

     

    if(equals(body('Select'), null), 'emsss@example.com', body('Select'))
     
    Also, I don't want to filter I want to replace!
     
  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @EMSSS 

     

    body('Select') would return output in json format  overall which won't be the null overall, so that is why it is not replacing null values 

     

     

    If possible could u show how output values body('Select') look like .

     

    Also do body('Select') is the output of select action, if yes you can replace null value there  easily 😊

     

     

  • VictorIvanidze Profile Picture
    13,073 on at

    Show your flow in edit mode.

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @EMSSS 

     

    If your result sets are returned as an array then use the following:

     

    image.png

     

    This will return only the values are not null.

     

    Thanks

  • EMSSS Profile Picture
    15 on at

    Hi,

     

    Thank you for your comment. I would like to replace the null value with my email rather then filter. Any idea on best way of doing this?

     

    Thanks

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @EMSSS 

     

    Not sure what you meant by? Please show a sample of data you getting from your flow run history and explain how you would like to format that data.

     

    Thanks

  • EMSSS Profile Picture
    15 on at

    Current Example:

     

    null,

    null,

    emsss@example.com

     

    Desired output example:

     

    emsss@example.com

    emsss@example.com

    emsss@example.com

     

     

    I want to replace null values in my array with a string value (my email)

  • VictorIvanidze Profile Picture
    13,073 on at

    You have been already told:

     

    if(equals(body('Select'), null), 'emsss@example.com', body('Select'))

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 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard