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 / How to convert empty s...
Power Automate
Suggested Answer

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)
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,362 Super User 2025 Season 2 on at
    Hi
     
    Can you try the expression
     
    string(null)
  • Suggested answer
    abc 123 Profile Picture
    784 Moderator on at
    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.

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