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

    

    

    https://docs.microsoft.com/en-us/azure/data-factory/tutorial-bulk-copy-portal#create-the-pipeline-iterateandcopysqltables

    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.

    MSDN

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

    @{activity('lookupActivity').output.value[0].tablename}

    also 

    @activity('lookupActivity').output.value[0].tablename

    { "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 :

    http://blogs.adatis.co.uk/sachatomey/post/2018/11/10/Azure-Data-Factory-v2-ForEach-Activity-Handling-Null-Items

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


    MSDN

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

    Just wanted to know - was your issue resolved?


    MSDN

    Friday, March 1, 2019 6:34 AM
    Owner
  • 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