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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Replace null with a value
Power Automate
Answered

Replace null with a value

(1) ShareShare
ReportReport
Posted on by 505

Using a Compose action, how can I when a null value is presented provide some generic value. So if x=null enter 1. I have an array variable going to an initialize variable using the array type and it is failing because of the null value.

Categories:
I have the same question (0)
  • Verified answer
    manuelstgomes Profile Picture
    6,625 on at

    Hi @send2mark 

     

    Here's the formula:

    if(equals(<VALUE TO TEST>,null),'Value if null','value if not null')

     

    You can check if the value is null or not. If it's not null you can put in the formula the same value otherwise your default value.

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    Cheers
    Manuel

  • Tryin2Flow Profile Picture
    7 on at

    This worked great for my flow.  Needed to create a "0" value when null and the entered value when not null. In compose > expression 

    Tryin2Flow_1-1658868257304.png

     

  • Suggested answer
    MP-08080224-0 Profile Picture
    2 on at
    The coalesce function returns the first non-null value.  So, you can do this:
    coalesce(<the value that might be null>,<the value you want to replace nulls>)
    or, using the values supplied in the original post:
    coalesce(x,1)
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard