ADF Passing parameter to DataFlow issue

Necmi Kilic 31 Reputation points
2022-10-23T07:11:43.733+00:00

Hi all,

I would like to pass output of web activity to dataflow using parameter. But I am getting the error "Incompatible data types between declared type and actual parameter value".

253274-image1.jpg

Here are my steps:

  • Declared a parameter with string type in dataflow

253190-image2.jpg

  • Assigned parameter's value from output of web activity (a REST call) with "@activity('ExternalFunction_T').output.Response"

Here is output of Web activity and inout of dataflow:
253229-image3.jpg
253292-image4.jpg

  • It throws the error below when I run the pipeline:

Job failed due to reason: "at Derive 'UnfoldNestedArrays'Parameter 'outputJsonData'(Line 12/Col 48): Incompatible data types between declared type and actual parameter value"

When invoking that line in derived column expression: unfold(split(dropRight(dropLeft($outputJsonData, 2), 2), '],['))

If I copy the output of web activity to parameter's value, it works fine. What can be the problem using $outputJsonData?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,685 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Subashri Vasudevan 11,206 Reputation points
    2022-10-24T07:40:14.41+00:00

    Hi @Necmikilic

    Thanks for providing screenshot with the details.

    On the right hand side, you pass the value as string, while on the left it is passed as array, and thats the reason for the error.

    Please try to convert the whole value to string before passing on to data flow parameter and let us know if that works.

    @ hide (activity('ExternalFunction_T').output.Response)

    thanks


  2. Necmi Kilic 31 Reputation points
    2022-10-24T08:15:06.207+00:00

    What I want to do was exactly the link below:
    https://learn.microsoft.com/en-us/answers/questions/1046785/index.html?ns-enrollment-type=Collection&ns-enrollment-id=rj3zidpo16jp14

    In this solution, I had started with a hardcoded string represented array of array value. I need to convert it to rows to save to a csv file or cache.

    But the value would come from Azure Function response like I shared. I need to pass this response to be parsed. Although my parameter type is String and convert the response to string, it still remains as array. Do you think unfold part must be changed?


  3. ShaikMaheer-MSFT 38,441 Reputation points Microsoft Employee
    2022-10-25T17:13:15.383+00:00

    Hi @Necmi Kilic ,

    Thank you for posting query in Microsoft Q&A Platform.

    Kindly use Set variable activity and set the web activity response string in to that and pass that variable as value to dataflow parameter. In data flow activity parameters tab uncheck expression checkbox.

    Passing strings to dataflows with quotes and slashes always little tricky. Kindly check below video if that helps to get idea about its behavior.
    Write dynamic expression for SQL with single quotes around parameter value in Mapping data flows

    Please let me know how it goes. If this helps please consider hitting Accept Answer button. Accepted answers helps community as well.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.