May I query for stored credential image layer from arcgis online
In the Query Layer activity for the Url of the layer I used the image layer from ArcGIS online which has the stored credentials, and the map service is came from my arcgis server. The map service has username and password which stored in ArcGIS online. May I used the stored credential image layer for Query Layer activity? I got no result back for the query.
Thanks
-
Hi Zhujing,
For secured layers, pass the Url object from the Get Layer activity into the Query activity. This object should contain your credentials.
Thanks, Stefan
0 -
Stefan, If I use the Get Layer activity, how could I save the credentials for the map service in the Layer Id object? And after that how could I pass the Url object in Query Layer from Get Layer? Thanks 0 -
Hi Zhujing,
You should be able to gather the generated token from the =$layer1.layer.url, then use a Parse URL activity, and lastly access the token with $parseurl1.query["token"].
Thanks, Stefan
0 -
Stefan, I put the activity order as Parse URL, get Layer and Query Layer, see my screen shot. I also try to input the =$layer1.layer.url to the query1.Url but got error says that is invalid. And last which activity and input should put $parseurl1.query["token"]? Thanks [cid:image002.png@01D30B87.C16664C0] 0 -
Hi Zhujing,
I've attached a basic workflow which shows how you can configure this process using a dummy service, but it shows the logical flow. Sorry for the confusion.
0 -
Stefan, What is the Layer Id in Get Layer? Is that the order of the map service in the web map? Here is my work flow, I still got error when I do the query. Please advise. Thanks 0 -
It doesn't appear as though your workflow was uploaded. The attachment clip icon is in the bottom left corner, just below this dialog box.
When used within Essentials, the Layer Id is the Id of the map service within your site according to the REST API Map page, with the Sublayer Id being the layer's ID within that map service, though that is not needed in this case. I am not sure how to find the ID of a web map hosted in AGOL, that might be in their documentation. I was able to Google and find this information for Portal: <portalurl>/sharing/rest/content/items/<webmapid>/data?f=json
The JSON should have the ID information.
0 -
Here is the my work flow in Jason.
0 -
In query layer for the URL I put as following , but it dose not work neither. Also even it would work my token is going to expire in one hour, how could I solve this issue?
="my ArcGIS server's site/arcgis/rest/services/Rockland/EM_Parcel/MapServer/0?token=" + $parseurl1.query["6omRWcYSSIwuqArN2-Qq2PYqGBPTPmhtAfaB1CQ_-NS4hyuvnophGgoZa7xUhkXBeFqmPS55NLRXsy0ZnNi9pg.."]
0 -
The logic in your workflow appears to be correct apart from the Query Layer configuration:
="PRINT_KEY LIKE " + $displayform1.state.TextBox1.value$displayform1.state.TextBox1.value
Which should be: ="PRINT_KEY LIKE " + $displayform1.state.TextBox1.value
Also, in the Alert further down in the workflow, you don't need to include .toString() in =$query1.features.length.toString()
0 -
$parseurl1.query["6omRWcYSSIwuqArN2-Qq2PYqGBPTPmhtAfaB1CQ_-NS4hyuvnophGgoZa7xUhkXBeFqmPS55NLRXsy0ZnNi9pg.."] should be $parseurl1.query["token"], this gathers the token parameter from the URL using the token key.
0 -
I changed the Url and Where in Query Layer as you can see in my attached json file.
But I still got the Problem running workflow error message.
0 -
Just to confirm, you are entering a valid PRINT_KEY value in the TextBox1 within the Display Form?
The error is likely originating now from the Select Features (Show Results) activity, since you'll need to set the appropriate Map Service and Layer settings for your map. You'll need to do some troubleshooting as to where in the workflow is failing now if this is not the case.
0 -
The PRINT_KEY value is valid. I am think about the token, how the program got the token, I did not input the user name and password for the map service then how the program get the token? Also I did not see the program use the proxy page neither. Thanks 0 -
Hi Zhyjing,
Sorry if this has been asked already, but I thought check - what type of field is PRINT_KEY? If it's a string (esriFieldTypeString), we could try changing the Where to:
"PRINT_KEY LIKE '" + $displayform1.state.TextBox1.value + "'"
If it's a number (esriFieldTypeInteger, esriFieldTypeDouble, etc) we could try
"PRINT_KEY = " + $displayform1.state.TextBox1.value
0 -
The field is ?esriFieldTypeString, so I change the where to "PRINT_KEY LIKE '" + $displayform1.state.TextBox1.value + "'"
But still got error when I run the workflow
0 -
?I used the GM5-search Query sample workflow and changed to my map service, I got the same error as I did my workflow.
0 -
Hi Zhujing,
Just to confirm, the where input is set to ="PRINT_KEY LIKE '" + $displayform1.state.TextBox1.value + "'" , including the '='?
Would you be able to attach your latest workflow in order for us to review?
Thanks, Stefan
0 -
Here is the Jason file for my workflow?
0 -
It looks as though there is a syntax error with the Where clause in the Query Layer, It should be: ="PRINT_KEY LIKE '" + $displayform1.state.TextBox1.value + "'"
0 -
Can you try to narrow down which activity is throwing the error? You can use Alert or Log activities between each of the existing activities to indicate which ones completed successfully.
0 -
I put the alert after Get Layer and before the Parse URL, and I got the alert. 0 -
Okay, what is happening is that our current implementation of Get Layer only supports GVH. Obtaining the layer information from WAB is a complicated process. I've created a feature improvement for this.
0 -
Ok thanks. 0 -
Hello Zhujing,
This feature has been completed and will be available with the next release of GW5. Keep an eye out in the 'What's New' section and the Release Notes for the 'Support for Get Layer in WAB' feature.
Thanks, Stefan
0
Please sign in to leave a comment.
Comments
25 comments