Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

How to convert empty string "" to null?

(1) ShareShare
ReportReport
Posted on by 2
Hello everyone, 
 
I have just got to know Power Automate and I'm building a flow. Currently I am facing a particular problem, which is I can't convert empty string "" into null.
 
The scenario is that I want to export my emails from my inbox into an SQL database. Due to several reasons, I am using HTTP request to fetch them and parse them and then handle them. Now, there are several parameters that are saved as an array and I wanted to convert them into a string. This is done by joining all the elements together with the join() function and saving the result into a new variable (called ccRecipients). If the array is not empty, it is working fine. However, when the array is empty, the variable becomes an empty string.
 
Now, I want to put this information into an SQL table. In this case, the corresponding column is represented as an empty string "". But I want it to be NULL. (See Result SQL.png)
Result SQL.png
 
Here are some approaches that I have tried, but they work :
  1. I have tried the null function (See Null.png) and it still gives me an empty string.
  2. I have tried using a variable whose initial value I do not specify, but this still also gives an empty string.
  3. I observed the raw input of the insert command and I noticed one thing. The parameter recipient has the value null. This will give me NULL in the database (See Result SQL.png). But then the parameter cc has the value "" (empty string), which causes the issue. I couldn't figure out how to get this null instead of empty string. (See Insert_raw_input.png)
       
Null.png                                                                                                                                                             Insert_raw_input.png
 
Does anyone have any idea how to solve this? Or other alternatives? Thank you in advance!
(If the pictures are not clear, please download the attachments)
  • Suggested answer
    abc 123 Profile Picture
    784 Super User 2025 Season 1 on at
    How to convert empty string "" to null?
    if(
      equals(
        coalesce(paramenterName, 'None'),'None'
      ),
       #null, 
       parameterName
    )
     
    #null implies that you need to use the Expression builder to add null, such that it's not interpreted as a string by the Flow.
  • Suggested answer
    Michael E. Gernaey Profile Picture
    44,463 Super User 2025 Season 1 on at
    How to convert empty string "" to null?
    Hi
     
    Can you try the expression
     
    string(null)

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1

Featured topics

Restore a deleted flow