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 :
- I have tried the null function (See Null.png) and it still gives me an empty string.
- I have tried using a variable whose initial value I do not specify, but this still also gives an empty string.
- 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)