title: 'int' is a primitive and doesn't support nested properties: Azure Data Factory v2
body: <p>I am trying to find a substring of a string as a part of an activity in ADF. Say for instance I want to extract out the subsctring <code>'de'</code> out of a string <code>'abcde'</code>. I have tried: </p>
  
  <pre><code>@substring(variables('target_folder_name'), 3, (int(variables('target_folder_name_length'))-3))
  </code></pre>
  
  <p>where <code>int(variables('target_folder_name_length'))</code> has a value of 5 and <code>variables('target_folder_name')</code> has a value of <code>'abcde'</code></p>
  
  <p>But it gives me: <code>Unrecognized expression: (int(variables('target_folder_name_length'))-3)</code></p>
  
  <p>On the other hand, if I try this: <code>@substring(variables('target_folder_name'), 2, int(variables('target_folder_name_length'))-3)</code></p>
  
  <p>This gives me: <code>'int' is a primitive and doesn't support nested properties</code></p>
  
  <p>Where am I going wrong?</p>