Try
<script>
this.scope.action = function(value){return value}
</script>
<style>
{{msg.style}}
</style>
<table>
<tr><td>{{msg.col1_header}}</td><td>{{msg.col2_header}}</td></tr>
<tr ng-repeat="obj in msg.payload" ng-click ="send({payload:action($index)})">
<td width="1%">{{ obj.name || obj.First}}</td>
<td width="99%">{{ obj.ip || obj.Last }}</td>
</tr>
</table>
Also de-select pass-through and add output message to stored state.
Example flow
[{"id":"bb393ea0830a192d","type":"inject","z":"452103ea51141731","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"ip\":1,\"name\":\"aa\"},{\"ip\":2,\"name\":\"bb\"}]","payloadType":"json","x":70,"y":4660,"wires":[["50612d14c11665d9"]]},{"id":"50612d14c11665d9","type":"ui_template","z":"452103ea51141731","group":"2d4fe667.28f8ba","name":"","order":17,"width":0,"height":0,"format":"<script>\nthis.scope.action = function(value){return value}\n</script>\n<style>\n {{msg.style}}\n</style>\n\n<table>\n <tr><td>{{msg.col1_header}}</td><td>{{msg.col2_header}}</td></tr>\n <tr ng-repeat=\"obj in msg.payload\" ng-click =\"send({payload:action($index)})\">\n\n <td width=\"1%\">{{ obj.name || obj.First}}</td>\n <td width=\"99%\">{{ obj.ip || obj.Last }}</td>\n\n </tr>\n</table>\n~~~","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":true,"templateScope":"local","className":"","x":300,"y":4660,"wires":[["e2fe93020cc45980"]]},{"id":"e2fe93020cc45980","type":"debug","z":"452103ea51141731","name":"debug 111","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":470,"y":4640,"wires":[]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":2,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]