title: Variable from lookup in a foreach block in Azure datafactory
body: <p>I'm trying to set up a simple pipeline in ADF. First step is selecting access tokens and logfilenames from a table on an MSSQL server. This works ok, preview shows a table containing two columns; token and logfilename. After this lookup I have a foreach loop which needs to do http requests to a REST API using the values in the columns token and logfilename. As items, in the foreach block, I set @activity('nameoftheactivity').output. In the foreach loop is a copy block. Source of this copy block is a REST API with its base URL (<a href="https://api.domain.com/v2/" rel="nofollow noreferrer">https://api.domain.com/v2/</a>), relative URL is set as</p>
  
  <p><code>@concat('logfile/',dataset().ForEachLogfilename,'.',formatDateTime(utcNow(), 'yyyy-MM-dd'),'.log/json?access_token=',dataset().ForEachToken)</code></p>
  
  <p>The ForEachLogfilename and the ForEachToken are set as Dataset properties with values as</p>
  
  <p><code>@{item().token} and @{item().logfilename}</code></p>
  
  <p>When I hit the preview button Azure suggest that I set values for @item().token and @item().logfilename which I do as suggested. A click on finish AND I HAVE DATA from the rest API. But only with the preview data... It just errors when I perform a "trigger now"... Can anyone point me in the right direction?</p>
  
  <p>cheers!</p>