Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

ToLower() fails with null but the input isn't null

(0) ShareShare
ReportReport
Posted on by 106

I am building a flow that alerts me if an email arrives that has certain words in the subject or is urgent.

The flow fires when an email arrives, and then checks if any of those conditions are true.

 

It worked somewhat okay, but in testing I discovered that it is case-sensitive, so I need to convert it to lowercase before I check the strings.

 

And this is where I need help. I thought it would simply be toLower(triggerOutputs()?['body/subject']) but when I tried that I meet a failure.

 

The toLower() function I used was written by me first, but when I tried the "suggest function by examples" the system also suggested the same formula. The error says it found a null input but none of my inputs are null in this case (of course it does need to handle an empty subject or importance anyway).

 

Setup:

ShawnKeeneTF_0-1676309163184.png

 

 

Failure: Input is null.  The email subject and importance were not null.

ShawnKeeneTF_1-1676309417137.png

 

 

What am I missing?

PS another user with basically the question: Building an autoreply flow

  • abm abm Profile Picture
    32,506 Most Valuable Professional on at
    Re: ToLower() fails with null but the input isn't null

    Hi @ShawnKeeneTF  @wskinnermctc 

     

    Think there is a bug in the flow designer that if you edit expression sometimes it won't update it for the first time. So always when you update an existing expression place your cursor over the expression and check via tooltip whether it is updated or not. If not edit the expression and update again. In my experience second time it always works. Something to remember next time.

     

    Glad to hear that all sorted.

     

    Thanks

  • ShawnKeeneTF Profile Picture
    106 on at
    Re: ToLower() fails with null but the input isn't null

    Crazy that must have been it.  I just created a new condition step that is absolutely identical and now it works totally fine. Crazy. Well I appreciate your help and time no less at all, thanks for the quick discussion.

     

    ShawnKeeneTF_0-1676314342456.png

     

  • Verified answer
    wskinnermctc Profile Picture
    6,517 Super User 2025 Season 1 on at
    Re: ToLower() fails with null but the input isn't null

    I just tested this multiple times even with a blank subject and the expression still worked. I double checked your expression and it appears correct to me.

     

    Can you try deleting your condition step and reapplying the expressions?

     

    Sometimes those boxes have previous expressions hidden in them that are hard to see. Like the expression might be applied twice or something in the same box but you can't see it.

     

    I can't tell why your flow is not working. 

  • abm abm Profile Picture
    32,506 Most Valuable Professional on at
    Re: ToLower() fails with null but the input isn't null

    Hi @ShawnKeeneTF 

     

    According to the error it is null. Did you checked the run history? Open the run history and inspect the trigger step. Check the values?

  • ShawnKeeneTF Profile Picture
    106 on at
    Re: ToLower() fails with null but the input isn't null

    I'm sorry I'm not clearly understanding where to add that... but in my example case none of these were null so that really shouldn't have been the true problem, right?  My subject and importance fields were non-null in my test case.

  • abm abm Profile Picture
    32,506 Most Valuable Professional on at
    Re: ToLower() fails with null but the input isn't null

    Hi @ShawnKeeneTF 

     

    Add an AND condition first to evaluate its not null AND add all the other conditions with OR.

     

    Thanks

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