Get source layerUrl from the "$getWorkflowInputs1.inputs.context[0]"
RéponduAnyone able to retrieve the layerUrl from the context[0] inputs?
Can someone help me on this.
I thought I was able to pull the id from
$getWorkflowInputs1.inputs.context[0].source.id and use "Get Layer" to retrieve the layerUrl
$layer1.layer.LayerUrl but when I checked in the logs, source is greyed out so I tried _source. Neither worked.
Then, by parsing the json. I used the id as input to "Get Layer" but output is undefined.
See below where I got the id.
geometry: {spatialReference: {…}, x: -13656809.215300001, y: 5703490.425899997}
id: "8294737f-940b-4101-91b8-c87ed46c8d02"
schema: {}
settings: {}
source: "item://sublayer-extension/5f151338-31ab-4ea6-a923-1facb40f94e2"
-
Different application contexts have different contextual inputs when running a workflow, so it's difficult to answer for sure here because I'm not sure whether you got here from a result, a popup, or another workflow (though it looks like it comes from a result to me).
Get Layer wont work with "item://..." as an ID, as that is the id of the application configuration item of the sublayer which launched the Workflow. Get Layer instead requires the ID of the layer (and sublayer when applicable) from the ArcGIS web map consumed in the application (unless the app is Geocortex Essentials). In your case, if this is being run from a result, I think you want the .source.layer.id property for your sublayer ID and it looks like you'll also need .layer.parent.id for the layer ID. More generally, you can view the map layers' ID's in the dev console after running a Get Map activity.
Side note: dimmed object properties in Chrome are simply non-enumerable, which just means they don't show up when enumerating the object's properties (depending on a few other things). I recommend binding to the .source instead of ._source when possible because properties with names prefixed by an underscore ("_") are usually meant to be internal to a class, meaning that the developer who wrote that class wants you to access that property another way. This isn't a hard rule and I don't think it will make a difference in this case, but it is a good rule-of-thumb.
0 -
It is from Results under "Results Panel". When I click on a feature, the Result tab will show the workflow( which I had configured under "Feature actions"). When I run the workflow, I want to get the layer information of the selected feature. I thought I can obtained that info from getworkflowinputs.
Maybe I am NOT configuring the Results in the right place or I have to do it a different way.
Basically, I just want the map information of the selected feature not the ID of the application config item (.. "item://...") .
0 -
In that case Jenny it does depend on how the results are populating.
If you're using a WF to populate it's easy to end up without the .source property (but that's a very fixable issue). By now I imagine you've figured out a workaround but if not then ensure that you're including the .layer property when creating results from graphics.
If the results are coming from an identify operation, .source should populate. It sounds like this might be how you're getting to the results though, so it's odd to me that you are getting the sublayer-extension id and not the actual sublayer-extension object like I am. I wonder whether upgrading your VS Web instance might help. If not, I would open a support case because what I'm hearing doesn't sound like the behavior that I saw when I test this today.
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
3 commentaires