In your index.html file, add and initialize the value:
<div ng-controller="dataCtrl">
<input ng-init="id=2374897289345" type="hidden"/>
</div>
Then open the app.js application and add a controller with the following code:
.controller('dataCtrl', ['$scope', function($scope){
console.log('Hello');
$scope.$on('flow::fileAdded', function (event, $flow, flowFile) {
$flow.opts.query = {id:$scope.id};
});
}])
Now you can access your file in the message.