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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,984)