Hi, yes you would need a foreach loop, that runs in sequential mode. Inside for loop, have a look up activity and set variable.
- In the data set that you use for lookup, no need to have a parameter for first row (as you have shown in the ss). So remove the dataset parameter. In your case probably you will need a parameter for current filename that tthe loop brings.
- Make sure to check first row as header in the same dataset
- Now in the look up activity, check First row only check box (tis is like select top 1 * in sql)
- Next to look up have a set variable, use the below expression
@activity('Lookup1').output.firstRow.State
This would give you the state information in each file stored on a variable. (Based on your use case for the variable value, can avoid it and make the loop run parallel too. So let us know what you do with the variable value)
Please let us know if this helps.
Thanks.