cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TesDA
Responsive Resident
Responsive Resident

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

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-...

 

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
1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
Pstork1
Dual Super User III
Dual Super User III

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

TesDA
Responsive Resident
Responsive Resident

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

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,450)