Drupal Views Datasource and Flag Links
Unfortunately I couldn't get the perfect solution to this so I had to use Views PHP. Remember to add a hidden field for the nid of the node

&lt;?php
$link = flag_create_link('MyFlagMachineName', $row-&gt;nid);
preg_match_all('/&lt;a[^&gt;]+href=([\'"])(.+?)\1[^&gt;]*&gt;/i', $link, $result);
if (!empty($result)) {
  echo $result[2][0];
}
?&gt;