POST
|
Thanks to both of you for your responses. Yes, you can get some information about feature using the REST API, but not nearly as much as you can by selecting the graphic on the map. For example, you can see below, the geometry from the REST Endpoint contains X and Y. However, from the Graphic there is much more data including hasM, hasZ, latitude, longitude, spatialReference, type, X and Y. It's the same things with layer. I was hoping there was an easy way to get around it, but it sounds like I will still have to go ahead a create a layer and select a feature to get all the same data, even if there isn't a map loaded. Is that right?
... View more
10-15-2019
03:08 PM
|
0
|
3
|
928
|
POST
|
When I select a feature on a map and use popup.getSelectedFeature() I get a great JSON object that has all kinds of information about the feature, including: feature attributes, the layer the feature is on, etc. That's great! Is it possible to get the same information when I don't have a map loaded? I have a page in my application where I don't have a map at all. I just show information from my own custom database that relates to features. I want to be able to open the same custom info panel that I created for use on my map page on this other page. To do that, I need the following information for the feature: feature._layer.id feature.geometry feature.geometry.type feature.attributes feature.getLayer().applyEdits I looked into using the ArcGIS REST API query, but it doesn't give me any information about the layer or the full geometry object. I hoping there is a way to select a feature using its ObjectID without a map. Thanks!
... View more
10-14-2019
02:51 PM
|
0
|
6
|
1035
|
POST
|
Hi James, Any update on this? I have a similar scenario where I have a public web form. A resident completes the form. I want to be able to send the same form to them a year later so they can see their previous responses and make any updates necessary. I suppose I could send them a link using the Survey123 Custom URL Scheme, but I would have to add every field single field to the URL. I'm wondering if there is an easier way. Perhaps just send the global ID of the record in question, or something like that? Thanks, Matt
... View more
08-18-2019
03:04 PM
|
0
|
0
|
226
|
POST
|
Hi AppStudio Team! I need to bring ArcGIS Runtime into Survey123 so I can sync feature services. I saw Erwin answered a similar question previously, but my situation is slightly different, so I thought it would be best to create a new thread. I asked about this over on the Survey123 forum. James Suggested we look at using parallel portal objects. We tried creating a parallel Portal object and we were able to get sync working (yeah!), the only problem is we have to sign in twice - once for the Survey123 portal object and once for the runtime object. Below is the code we are currently using. We will always be signed into Survey123 and have an Esri user access token when we run sync. Is it possible to create a new portal object using an access token instead of a username and password? var portal = ArcGISRuntimeEnvironment.createObject("Portal", {url: "https://www.arcgis.com"});
var credential = ArcGISRuntimeEnvironment.createObject("Credential");
credential.username = "[portal username]";
credential.password = "[portal password]";
portal.credential = credential;
portal.loadStatusChanged.connect(function(){
if (portal.loadStatus === Enums.LoadStatusLoaded) {
var info = portal.portalInfo;
var licenseInfo = info.licenseInfo;
// update licence Info
ArcGISRuntimeEnvironment.setLicense(licenseInfo);
console.log("licensceLevel after Update:"+ArcGISRuntimeEnvironment.license.licenseLevel);
} Thanks! Matt
... View more
01-18-2019
10:40 AM
|
0
|
1
|
355
|
POST
|
Thanks James. I will take it up with the AppStudio forum.
... View more
01-15-2019
02:38 PM
|
0
|
0
|
314
|
POST
|
I have a web app that uses OAuth2 to authenticate Esri named users. I have an access token for the user and, if the feature service is "secured" (not shared with public), I append the token to the feature service to load it (e.g. "[feature service url]?token=[token]") . It used to be that if I appended the token to a "public" feature service (share with everyone), then I would get an error and the service wouldn't load. That meant I would have to track which services were "secured" and which were "public" and request the data accordingly. I noticed on AGOL the other day when I looked at the details page of a "public" feature service that an access token was appended to it. I thought that was interesting, so I started experimenting. It appears that I can now append an any Esri access token to a "public" feature service and it will still load as long as the token is valid. I have 3 questions on this topic: Is my understanding correct, that you can append an access token to a "public" feature service and it will still load? If that is correct, when was the change made? Is it documented somewhere? Will that always work in the future? If so, I am going to simplify my codebase and always append an access token to feature services. If it is uncertain, I might need to leave it all in "just in case". Thanks!
... View more
01-15-2019
02:35 PM
|
0
|
0
|
259
|
POST
|
I just learned over on this thread that Survey123 doesn't actually use the Runtime Portal object. I am modifying Survey123 in AppStudio and I need to be able to sync feature services, so I need Runtime. Any recommendations on how to approach this? Should I replace portal or make a new object that uses Runtime Portal? Thanks, Matt
... View more
01-11-2019
11:32 AM
|
0
|
2
|
396
|
POST
|
Paul, Yes! That is what I was missing. Survey123 doesn't use the Portal Runtime object. I switched to the sample "Portal User Info" and it worked great. If anyone is curious, below is the code I used: Portal {
id: portal
credential: Credential {
oAuthClientInfo: OAuthClientInfo {
oAuthMode: Enums.OAuthModeUser
clientId: "T3Gjh6a2d0MK14ke"
}
}
Component.onCompleted: load();
onLoadStatusChanged: {
if (loadStatus === Enums.LoadStatusLoaded ) {
console.log("**************** Signed in! ****************")
console.log("license level before: "+ArcGISRuntimeEnvironment.license.licenseLevel)
}
if (loadStatus === Enums.LoadStatusFailedToLoad)
retryLoad();
}
} Which resulted in: License level 2! Just as I was hoping. Thanks for everyone for helping with this! Matt
... View more
01-11-2019
11:23 AM
|
0
|
0
|
288
|
POST
|
I just can't figure out if portal is an object or a string. Let me show you what I mean. Below is what I put into the S123 app: console.log("Signed in!");
console.log("portal:"+portal);
console.log("portal JSON:"+JSON.stringify(portal.json));
console.log("portal.user:"+JSON.stringify(portal.user));
console.log("portal.portalInfo:"+portal.portalInfo); Here is what shows in the log: When I try to stringify portal, I get undefined, but when I stringify portal.user I get an object. That doesn't make any sense to me. If portal.user contains information, then portal should be an object, right? What is going on? Would it be helpful if I shared the entire codebase so you could run it yourself? It is simply the Survey123 template with the console.log added to onSignedInChanged in SurveyApp.qml.
... View more
01-10-2019
02:06 PM
|
0
|
2
|
1433
|
POST
|
Hi Thomas, I am just trying to use the Survey123 template. With the code for that app, it looks like the portal object is created on line 503 of SurveyApp.qml (see the file I uploaded previously and below). Portal {
id: portal
...
onSignedInChanged: {
...
if (signedIn) {
userInfo = portal.user;
writeUserInfo();
console.log(qsTr("Signed in!"));
console.log("Signed in!");
console.log("portal:"+portal);
console.log("portal.portalInfo:"+portal.portalInfo);
console.log("portal.portalInfo.licenseInf:"+portal.portalInfo.licenseInf);
ArcGISRuntime.license.setLicense(portal.portalInfo.licenseInfo)
}
}
}
There is a function onSignedInChanged (see line 536) inside Portal. I'm just really confused with the object portal. When I use console.log to view portal, I just get a string. But when I use portal.user, it returns the user information. However, portal.portalInfo is undefined. So, I have 2 questions. What is up with the portal object? Why do I get a string with console.log("portal:"+portal) but I get an object with console.log("portal:"+portal.user). Shouldn't portal.portalInfo be defined in the code block above? What am I missing? Thanks, Matt
... View more
01-09-2019
10:31 AM
|
0
|
4
|
1433
|
POST
|
Is anyone else having this issue where portal.portalInfo is undefined? I'm confused. I would have thought portal would be a big JSON object, not a string like is shown above. I must be missing something.
... View more
01-08-2019
07:54 PM
|
0
|
6
|
1433
|
POST
|
Hi Lauren, The named user licensing sounds perfect, but I'm having some issues accessing portal.portalInfo. For testing purposes, I created a new app using the Survey123 template. I added the following lines to the onSignedInChanged function (see attached for the modified file). console.log("Signed in!");
console.log("portal:"+portal);
console.log("portal.portalInfo:"+portal.portalInfo);
console.log("portal.portalInfo.licenseInf:"+portal.portalInfo.licenseInf); And below is what I'm getting in the log: portal.portalInfo is undefined. It appears that portal is a string and not a JSON object. What am I missing? Thanks, Matt
... View more
01-07-2019
11:56 AM
|
0
|
0
|
1433
|
POST
|
Hi Lauren, Thanks for the info and the quick response! I didn't realize there was an option to license our application with the Named User license. I checked out the link you sent and it looks pretty straight-forward. After the user signs in with their portal named user, then we can use info.licenseInfo and ArcGISRuntimeEnvironment.setLicense(licenseInfo) to license our application with the Named User license. Then, as long as the user is level 2 Name User, they will have access to the "Basic" level capabilities (sync, add, delete, edit). Did I get that right? Thanks, Matt
... View more
01-02-2019
02:56 PM
|
0
|
9
|
1433
|
POST
|
I was told I would need "Basic" Runtime license level unless I used Esri named users. I am authenticating using Oauth2 and Esri named users, but when I try to run the code below, I get an error message, "Attempt to use functionality that is not supported for the current license level". My current license level is "Lite". Shouldn't I be able to sync with "Lite" using named users? Thanks, Matt function executeSync(databasename,index) {
resultProgress.value = 0;
var content=layersModel.get(index);
var synctaskid=content.layerId+"_syncTaskId";
var x=content.layerUrl.substring(content.layerUrl.lastIndexOf("/"));
var featurelayerid=x.replace("/","");
var Urlsplitted=content.layerUrl.replace(content.layerUrl.substring(content.layerUrl.lastIndexOf("/")),"");
syncLayerOptions.layerId=featurelayerid;
var newObject1=ArcGISRuntimeEnvironment.createObject("Geodatabase", {id:"gdb",path:outputGdb+"/"+databasename,serviceUrl:Urlsplitted});
var newObject2=ArcGISRuntimeEnvironment.createObject("GeodatabaseSyncTask", {id:synctaskid,url:Urlsplitted});
syncJob =newObject2.syncGeodatabase(syncParameters, newObject1);
delay(1000, function() {
if (syncJob) {
syncWindow.open();
simpletimer.start();
resultProgress.value += 1.0;
syncJob.credential.token=app.portal.token;
syncJob.jobStatusChanged.connect(updateSyncJobStatus);
simpletimer.running=false;
simpletimer.stop();
syncJob.start();
} else {
syncWindow.open();
statusText = "Sync failed";
syncWindow.hideWindow(5000);
console.log("sync else");
}
});
}
... View more
01-02-2019
01:07 PM
|
0
|
11
|
2091
|
POST
|
Perfect. Thanks! And thanks for pointing out the screenshot feature in the other thread. Good to know. You guys are great!
... View more
12-19-2018
10:31 AM
|
1
|
0
|
238
|
Title | Kudos | Posted |
---|---|---|
1 | 10-11-2023 01:33 PM | |
3 | 05-31-2022 10:40 AM | |
1 | 05-31-2022 10:37 AM | |
3 | 03-08-2021 09:02 AM | |
1 | 07-08-2021 09:51 AM |
Online Status |
Offline
|
Date Last Visited |
11-01-2023
11:58 PM
|