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 / Power automate if expr...
Power Automate
Answered

Power automate if expression returns error

(0) ShareShare
ReportReport
Posted on by 19
Hi,

I have a cloud flow that gets triggered on schedule and the I run a query against a Power BI dataset to get some data. I use those data to create an html table.
I am using a select action to create an array out of the Power BI dataset retrieved. On the select value I have an expression before the Power BI item that adds a string as a prefix on the value in case a condition is met.
In order to make my life easier I have created a column in the BI dataset that checks the condition and returns true or false. So, in the select I write this expression if(item()?['BIdataset[Flag]'], 'AddString', '') and then the item from power bi. This was working for over a year until 3 weeks ago when I started getting a specific error.
On the select action I get the following error "'The template language function 'if' expects its first parameter to be of type boolean. The provided value is of type 'Null'". Sometimes re running the flow ad hoc solves the problem but other times I have to rewrite the expressions. I know for a fact that the column Flag has always one out of the two values True or False.
 
Also, when I open the failed flow run on the inputs there is not a single instance that the Flag field gets a null value.
 
Does anyone have any idea why is this happening?
 
Am I missing something in my flow?
Categories:
I have the same question (0)
  • Verified answer
    David_MA Profile Picture
    14,761 Super User 2026 Season 1 on at
    Change your expression to a coalesce expression. It is designed to handle null values and returns the first non-null value from the expression. You would update your expression to coalesce(if(item()?['BIdataset[Flag]'], 'AddString', ''), null) 
     
    Do not type null, but choose the null function from the expression builder. And of course, you can replace null with some other value when the value is empty as well. Just put it in single quotes. For example, coalesce(if(item()?['BIdataset[Flag]'], 'AddString', ''), 'not set') instead.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 386

#2
Valantis Profile Picture

Valantis 342

#3
Haque Profile Picture

Haque 336

Last 30 days Overall leaderboard