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 / Error: 'The template l...
Power Automate
Unanswered

Error: 'The template language function 'length' expects its parameter to be an array or a string. The provided value is of type 'Null'.

(0) ShareShare
ReportReport
Posted on by 611

Hello!

 

I'm trying to check if an item exists, and then if it doesn't add a row to a sharepoint list based on - https://powerusers.microsoft.com/t5/Building-Flows/How-to-check-if-item-already-exist-in-SharePoint-list/td-p/780008

 

however I keep running into an error in the condition: 

 

Unable to process template language expressions for action 'Condition_2' at line '1' and column '23513': 'The template language function 'length' expects its parameter to be an array or a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#length for usage details.'.

 

 
 
nullfail2.jpgnullfail.jpg
Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    You'll want to do the length on just outputs('Get_items_2')?['body/value'] rather than the specific field.  If Get Items doesn't find items the field won't exist, but the output array will.

  • TesDA Profile Picture
    611 on at

    I knew it would be something simple! Thanks for the speedy reply @Pstork1 !

  • subsguts Profile Picture
    1,259 Moderator on at

    @Pstork1 I'm getting the same error message and this is my length statement.  What am I doing wrong?  Thanks!

    length(outputs('Get_rows_(V2)')?['body'])

     

    Sorry for this post, I looked @Pstork1  reply again and saw I didn't have the /value

     

    so it worked after I added that.

  • Verified answer
    Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    Check the output of your Get rows V2 action.  It looks like its returning a null value.  One way to deal with that is to use a Compose inside the length to substitute an empty string if the get rows retuns a null.  That will give you a lenght of 0

     

    I would also check the value instead of the body.  So it should be this

    length(outputs('Get_rows_(V2)')?['body/value'])
  • Graham79 Profile Picture
    20 on at

    I am getting a similar error message regarding "The template language function 'length' expects its parameter to be an array or a string. The provided value is of type 'Null'"
    Below is my current flow which looks for new Sharepoint list entries, searches for the created by field and gets the person's email address, to then send them a Team chat and email to alert them of new entry. Appreciate any assistance to correct this issue.

    Graham79_0-1694584394059.png

     

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    Please post this as a new question.  You'll get more responses and others will be able to find the answer more easily later.

  • Community Power Platform Member Profile Picture
    on at

    Okay I'm try to do it the way you are suggested fellows which is 

    length(outputs('Get_rows_(V2)')?['body/value']), the flow runs whiout errors but insteady of adding anly the newly added records it's actually creating all items againg meaning I'm having duplicates 
  • Community Power Platform Member Profile Picture
    on at

    Okay I'm trying to do it the way you have suggested fellows which is 

    length(outputs('Get_rows_(V2)')?['body/value']), the flow runs without errors but instead of adding only the newly added records it's actually creating all items again meaning I'm having duplicates 
  • steve_hendy Profile Picture
    385 on at

     number column this worked for me 

    steve_hendy_0-1715331070734.png

     

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard