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 / 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)
  • 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)
     
  • 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

     

  • 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

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
David_MA Profile Picture

David_MA 245 Super User 2025 Season 2

#2
Expiscornovus Profile Picture

Expiscornovus 207 Most Valuable Professional

#3
trice602 Profile Picture

trice602 190 Super User 2025 Season 2

Last 30 days Overall leaderboard