Being Real
Being Real

Reputation: 83

Foreach Loop Not working as expected in Azure Data Factory

My Lookup activity Output in ADF have 10 rows. I want to take only the output of first 5 rows dynamically inside foreach loop. So what expression need to put inside my items expression of Foreach Activity.

Upvotes: 1

Views: 761

Answers (2)

wBob
wBob

Reputation: 14379

You can use the take function to get the first five items from your collection. Set this in the Items property of the For Each activity:

@take(variables('vArray'),5)

An example:

ADF with take

Upvotes: 1

Nandan
Nandan

Reputation: 4925

You can use rownumber in dataflow to generate the row numbers http://datanrg.blogspot.com/2020/10/row-numbers-in-azure-data-factory-data.html?m=1

And then use filter activity to filter top 5 rows

Upvotes: 0

Related Questions