We have created application using Developer edition of WAB and it's using one Web Map and in that web map we have one hosted layer also. We have one Custom widget for adding co-ordinates,Once user enters all co-ordinates (lat/lng) user can click on finish button and this will create a feature in hosted feature layer published on AGOL.
I have done
_finishGeom: function() {
var poly = new esri.geometry.Polygon();
var ring = new Array();
var firstpoint = null;
var points = this.cordTable.getData();
array.forEach(points, lang.hitch(this, function (point) {
var p = new esri.geometry.Point(point.lat, point.lng);