ADF Failure: Function "Length" expects its parameter to be array or string RRS feed

  • Question

  • I am trying to practice the below tutorial, facing below error message on second pipeline [IterateAndCopySQLTables ]. As per below tutorial, I have created parameter of type Array "tableList". Seeking help here.


    Activity IterateSQLTables failed: The function 'length' expects its parameter to be an array or a string. The provided value is of type 'Null'.

    • Edited by azureuser9 Monday, February 11, 2019 7:31 PM
    Monday, February 11, 2019 7:02 PM

All replies

  • Hi there,

    Looks like the parameter doesn't hold any value when the ForEach activity is invoked. 

    To narrow down to the exact issue, I would recommend making sure the following things are in place :

    • When setting parameter "tableList" in the pipeline "IterateAndCopySQLTables", the type is set to "Array".
    • In the forEach activity, the Items in the settings tab is set to "tableList" in the format "@pipeline().parameters.tableList". (Looks like there's a typo in the doc, it says parameter instead of parameters)
    • The query in the Lookup Activity is correct (you can test it using SQL Server Management Studio or on the portal using query editor.
    • In the parameters for the InvokePipeline activity, the parameter tableList is set to @activity('LookupTableList').output.value.


    Wednesday, February 13, 2019 10:32 AM
  •  i need to acess an element from  value output. I'm using this code that i copied form ms docs:




    { "errorCode": "InvalidTemplate", "message": "The function 'length' expects its parameter to be an array or a string. The provided value is of type 'Integer'.", "failureType": "UserError", "target": "ForEach1" }

    Tuesday, February 26, 2019 8:44 PM
  • Hi Denilson,

    I found an interesting blog that might help you understand how it works better :

    Have a look at this and let us know if it helps you. Else we can gladly continue to probe in further.


    Wednesday, February 27, 2019 7:52 AM
  • Hi Denilson,

    Just wanted to know - was your issue resolved?


    Friday, March 1, 2019 6:34 AM
  • Hello

    I am having exactly the same problem. Can you please let me know if there is any solution for this? 

    Sunday, May 19, 2019 1:46 PM