I am trying to write an app that creates a feature service, however I am seeing some strange things (or it might/hopefully just be me). I won't go into each iteration I have tried but I will summarise some of the results and comments.
var jsonFS = appFolder.fileUrl("featureService.json")
using a local file file:// (FileFolder.fileUrl from AppFramework) successfully creates the item but when I look at the service in ArcGIS.com I get an error loading the table in the data tab. Could you please be specific to what actually has to go into this file. I copied a previous feature layer JSON content and saved it to a file. I have attached a link at the bottom. Also the service URL is malformed.
addPortalItemWithUrl(newTracklog, "https://www.dropbox.com/s/b8mvzyo82108irw/featureService.json", jsonFS)
Using a http:// file successfully added the item by using a feature service url but now the service url is pointing to the original feature service. It has effectively made a layer view. Once again what am I supposed to do with this. Also tested with a url outside of the environment and get a successful creation but invalid data.
Look forward to hearing what I am doing wrong