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 / Length Condition False...
Power Automate
Answered

Length Condition False Positive

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I am working on a weekly reminder flow for items that are pending approval. For the sake of testing, I'm manually triggering it. Even though my SharePoint list currently has no open items to be approved, the Length statement is registering as 1 which causes an empty email to be sent. I would appreciate if someone could take a look at my flow steps and expressions and let me know what I am doing wrong. Thanks!

 

I've tried writing the Filter Query with eq the two statuses where something would be considered pending. This doesn't generate a different result from the outcome of the steps below.

 

Trigger-GetItems.png

I've tried writing the Length statement with just 'Get_items', 'Get_items/body', and 'Get_items/value'. The result generated is always 1.

 

Compose.png

The first Output in email step is the Compose statement, the second is the html table.

 

Email.png

 

The result of the email is an item count of 1, but no html table showing any items. Why is it computing as 1 when there are no open items? I'm hoping I'm just missing something obvious and that it isn't a bug. Thanks in advance for your help.

 

Email Result.png

 

Kind regards,

Teresa

Categories:
I have the same question (0)
  • Verified answer
    Zacharie_Cortes Profile Picture
    170 on at

    Hello @tagustin2020 ,

    Have you tried to look at the JSON output of your "GET ITEMS" ? Maybe you will find the gost line ...

    PS : if the JSON in not readable in the browser, consider installind an add-in to your browser that can format JSON a way than you can read it.

  • Verified answer
    Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @tagustin2020 

     

    The formula createArray('Get_items/value') create an array with 'Get_items/value' as an element so it always returns 1 when calculating its length.

     

    Please try using the below expression in 'Compose' action to get the correct value:

    length(outputs('Get_items')?['body/value'])

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • tagustin2020 Profile Picture
    on at

    @Zacharie_Cortes 

     

    Hello Zacharie,

     

    Thank you for the quick reply. The JSON output is not accessible in the flow run and I don't have permissions to install any programs on my work computer so I'll have to submit an IT ticket. Since this might take awhile, I'll go ahead and accept this suggestion as a solution for now. Have a good day!

     

    Teresa

  • Zacharie_Cortes Profile Picture
    170 on at

    The ugliest solution that works too is to make a "for each element" loop where you increase a variable

  • tagustin2020 Profile Picture
    on at

    @ManishSolanki 

    @Zacharie_Cortes 

     

    Thank you, Manish! That did the trick. I really appreciate both of you responding so quickly. Have a wonderful day!

     

    Teresa

  • Zacharie_Cortes Profile Picture
    170 on at

    @tagustin2020 :
    If you ever acces the json, you can read it by copy/pasting it in an online formater as this one : https://jsonformatter.curiousconcept.com/ 😉

  • tagustin2020 Profile Picture
    on at

    @Zacharie_Cortes 

     

    Thank you, Zacharie. I appreciate the tip 😀

     

    Teresa

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 632

#2
Haque Profile Picture

Haque 458

#3
Valantis Profile Picture

Valantis 357

Last 30 days Overall leaderboard