Patterson
Patterson

Reputation: 2805

Azure Data Factory Error 'item' is not a recognized function PT2

I have asked a similar question, however this question relates to a SINK location.

I have configured my sink as described enter image description here

My configuration looks like the following: enter image description here

Can someone let me know what I need to do get resolve this error? Let me know if you need more details

I have passed the @item as a Parameter, see image. Any suggestions as to what to now Place in the Directory enter image description here enter image description here enter image description here

Upvotes: 0

Views: 197

Answers (1)

Saideep Arikontham
Saideep Arikontham

Reputation: 6114

You can pass the following dynamic content as a value in the Directory field of File Path. The below would fetch the required output.

@{dataset().Directory} 
  • But the warning 'item' is not a recognized function would impact the dataset only if @{item().Currency} is absent. If this dataset is used appropriately in a pipeline, it would fetch the required results anyway.

  • @{item().Currency} is valid inside for each activity. Since you are using @{item().Currency} in the dataset that is being used inside For each Currency activity (as sink of copy activity and hence @item().Currency is valid), it would give desired results. Look at the following demonstration.

  • I am using @{item().Currency} in the dataset called op1.

enter image description here

  • I am using the above op1 dataset as my sink for copy data activity (which is inside for each activity).

enter image description here

  • Now when I click Debug, though there is a warning saying item' is not a recognized function, the pipeline would succeed without any errors (I used lookup activity for demo).

enter image description here

  • The copy activity runs successfully and writes the required file into a folder structure of the given format. The following is an image of my blob storage (my sink).

enter image description here

  • So, you can ignore the warning message as long as you are using @item().Currency with a dataset that is present inside a For each activity where @item().currency is a valid value.

NOTE: You cannot use the above dataset for other activities of pipelines where @item().Currency does not exist. If you do so, the warning message prevails, and the pipeline would fail with an error.

Using @{item().Currency} inside the dataset directly is not incorrect as you can see from the above demonstration. But it is a better practice to pass the value to a dataset parameter.

Upvotes: 1

Related Questions