Hoppa till huvudinnehållet

Using a workflow to return a feature and show results as configured for the layer

Kommentarer

16 kommentarer

  • Heather Widlund

    I got this to work. In the Get Layer activity, the Layer ID to use was the id (and not layerId!) of the sublayer as found in the Get Map log/console. It is a string of letters and numbers: 18c06f142a4-layer-93 for example. Using the layer name and sublayer id number did not work at all, but using this id did. Now I just wish I could expand the results by default.

    I also learned about launch links and getting URL workflow parameters from this thread, instead of getting and parsing the URL directly which didn't end up working.

    Thanks to everyone who participates in this forum and helps us figure things out.

    2
  • Heather Widlund

    Also, it was key in the query activity querying the layer from the Get Layer activity to return all fields (*).

    2
  • Shelby Kline

    Hi Heather,

    I'm working on a similar WF. I think running the results.set-list-view-mode command with the ungrouped parameter might be what you're looking for.

    I followed Matthew's comment on this post and added a results.display-details command to jump straight to the result details. Not sure if that's the "correct" way to do it, but it worked for me :)

    1
  • Heather Widlund

    Thanks, Shelby, I will try that!

    0
  • Jonathan Dandois

    On a similar note, (Shelby Kline and I work together) we've recently found the need to use the Set Property activity in Workflow to customize the feature's Esri JS 4.x popupTemplate property as the newly queried features have a popupTemplate of null and the results display in Web apps is blank.  Perhaps a combination of the two?  This was recommended by @... for a different workflow trying to achieve the same goals. 

     

    0
  • Matthew Poirier

    The default behaviour if you query by URL and return all fields (*) or a selection of fields in a workflow and then show results should be a result summary with the default title field, and then a full list of those fields in the results details. 

    Using the layer input instead of the URL input ensures that the results set is linked to the layer from the webmap being used in your app, and should result in any customized popup configuration from your webmap being applied when you show the results. 

    In the case of your workflow Jonathan it wasn't quite as straightforward since we were appending maximo results and building our own collection object, but the principle is the same in that you could get query results by URL and then apply a popup configuration to the features that it returns. Then Web will use that popup configuration when it displays results.

    0
  • Heather Widlund

    Yes, when I returned all fields, I got the results to populate with the pop-up configuration.

    The results.set-list-view-mode didn't work for me when I stuck it between the query and the ShowResults activity. Maybe I misinterpreted how it works, because I'm not using your subsequent command activity results.display-details and I don't know what the command parameter for that would be. =$layerQuery.results doesn't work as a parameter - shows nothing.

    1
  • Heather Widlund

    I got results.set-list-view-mode to work when followed by results.display-details in a workflow that had been created by a Quick Query template. In that case, the parameter for the display-details command was ={features:$results.result}. However, nothing will make this work in another workflow that is just a layer query. I've tried =$layerQuery.results, =$layerQuery.features, =$layerQuery.results.features, ={features:$layerQuery.results}… It doesn't display the details at all or highlight the parcel. As soon as I turn it back to ShowResults with =$layerQuery.results, it does everything except expand the results automatically. I'd really like to get this to work. Any thoughts?

    0
  • Matthew Poirier

    Hi Heather,

    If you're trying to display results using a results.display-details command with the results from a Query Layer activity then you'll want to perform the extra step of converting the query results (which are Esri Graphics) into actual VertiGIS results using the results.from-graphics operation.

    Below is an example workflow that will work with the Buildings layer in a Capital City 2.0 webmap as found in the Web GIS Default template app in VSWeb. 

    If you need additional assistance please go ahead and submit a support ticket and work on this more.

    {
    "_properties":
        {
        "isServerWorkflow": false
        },
    "components":
        [
            {
            "id": 2,
            "steps":
                [
                    {
                    "id": 3,
                    "inputs":
                        {
                        },
                    "position": "0,0",
                    "purpose": "start",
                    "title": "Start",
                    "transitions":
                        [
                            {
                            "id": 5,
                            "position": "90,60 90,140",
                            "target":
                                {
                                "id": 4
                                }
                            }
                        ]
                    },
                    {
                    "action": "gcx:wf:arcgis::GetLayer",
                    "id": 4,
                    "inputs":
                        {
                        "layerId": "Buildings"
                        },
                    "name": "layer1",
                    "position": "-30,140",
                    "title": "Get Layer",
                    "transitions":
                        [
                            {
                            "id": 7,
                            "position": "90,210 90,280",
                            "sourceConnector": "bottom",
                            "target":
                                {
                                "id": 6
                                },
                            "targetConnector": "top"
                            }
                        ]
                    },
                    {
                    "action": "gcx:wf:arcgis:query:QueryTask",
                    "id": 6,
                    "inputs":
                        {
                        "layer":
                            {
                            "accessors":
                                [
                                "$layer1"
                                ],
                            "annotations":
                                [
                                    {
                                    "count": 7,
                                    "index": 0,
                                    "kind": "idref"
                                    }
                                ],
                            "code": "$layer1.layer",
                            "source": "$layer1.layer"
                            },
                        "outFields": "*",
                        "where": "STREET = 'GOVERNMENT ST'"
                        },
                    "name": "query1",
                    "position": "-30,280",
                    "title": "Query Layer",
                    "transitions":
                        [
                            {
                            "id": 15,
                            "position": "90,350 90,410",
                            "sourceConnector": "bottom",
                            "target":
                                {
                                "id": 8
                                },
                            "targetConnector": "top"
                            }
                        ]
                    },
                    {
                    "action": "gcx:wf:app::RunOperation",
                    "id": 8,
                    "inputs":
                        {
                        "operationName": "results.from-graphics",
                        "operationParameter":
                            {
                            "accessors":
                                [
                                "$query1"
                                ],
                            "annotations":
                                [
                                    {
                                    "count": 7,
                                    "index": 12,
                                    "kind": "idref"
                                    }
                                ],
                            "code": "{ \"graphics\": $query1.features }",
                            "source": "{\"graphics\":$query1.features}"
                            }
                        },
                    "name": "runOperation1",
                    "position": "-30,410",
                    "title": "Run Operation",
                    "transitions":
                        [
                            {
                            "id": 19,
                            "position": "90,480 90,580",
                            "sourceConnector": "bottom",
                            "target":
                                {
                                "id": 12
                                },
                            "targetConnector": "top"
                            }
                        ]
                    },
                    {
                    "action": "gcx:wf:app::RunCommand",
                    "id": 12,
                    "inputs":
                        {
                        "commandName": "results.display",
                        "commandParameter":
                            {
                            "accessors":
                                [
                                "$runOperation1"
                                ],
                            "annotations":
                                [
                                    {
                                    "count": 14,
                                    "index": 10,
                                    "kind": "idref"
                                    }
                                ],
                            "code": "{ features: $runOperation1.result }",
                            "source": "{features:$runOperation1.result}"
                            }
                        },
                    "position": "-30,580",
                    "title": "Run Command"
                    }
                ]
            }
        ],
    "deploymentConfig":
        {
        "supportedApps":
            {
            "VSW": true
            }
        },
    "designerVersion": "5.38.1+5",
    "licenseInfo":
        {
        "licenseeId": "88cb61d6-af47-9b3e-5181-ed674c4c0815"
        },
    "start":
        {
        "id": 3
        }
    }
    0
  • Heather Widlund

    Thank you, Matthew! That worked. I added Run Operation with the command results.from-graphics, with the parameter ={graphics:$layerQuery.features}. Then for my results.display-details I used the parameter =$runOperation1.result.

    Thank you so much for the assistance. I've been banging my head against the wall all afternoon.

    1
  • Matthew Poirier

    Hi Heather,

    Glad I could help! For posterity, the alternative solution to my example workflow above would be to use a Show Results activity with the Query Layer results as the features, and the Layer ID as the Layer ID input:

     

    This will convert the query layer results to a proper results format within the activity. And note that in your Quick Query template example that worked without the additional conversion operation because the tasks.query operation automatically returns a VertiGIS wrapped object type compatible with the results.display command:

    0
  • Megan Ovenden

    Hi @...  Cam Barnard 

    I am running into a problem related to this thread, the workflow is mostly functional however when the results are displayed in Studio Web, commands such as a Buffer Results do not work. Would you be able to assist in identifying what I've done wrong? The Buffer Results should return all features that intersect the buffered area. I did try with both a Show Results activity as well as a run operation/runcommand.

    0
  • Matthew Poirier

    Megan Ovenden I would recommend you submit a support request (https://support.vertigis.com/hc/en-us/articles/11461033129618-How-to-submit-a-Support-Request), attach your workflow, and be sure to note your software version for Web. Then I or one of my support colleagues will be assigned the ticket, and have a look to see if we can reproduce the issue and what the solution might be.

    Thanks!

    1
  • C Clark

    Hi Matthew,

    I am using the results.from-graphics and then the results.display-details to jump right to the details and it is working great, however my highlighted label is my feature layer name and the “pop-up” in the details doesn't have title or description as it would when using the Show Results activity.  Is this acheivable with this workflow?  I am using a get map and get layer prior to query.

    0
  • Christian Ullmann

    Hi C Clark,

    I archived to show also the correct popup formatting and layer name by using the following activity pipeline:

    get layer → query layer → run operation / results.from-graphics → run operation / results.display

    From the query layer activity you get a “features” and “results” ouput. This must be passed to the results.from-graphics operation as a parameter in the form:

    ={
     graphics: $queryLayer1.features,
     layer: $queryLayer1.result
    }

    0
  • C Clark

    Hi Christian.  

    I think this is not working for me because I do not get the correct layer id from the get map / get layer activities. I am using this expression: =$map1.map.map.allLayers.items.filter( x => (x.title == "Water Facility"))[0].id, but the name of the layer is called “Water Service Locations” and it is inside the Water Facility group layer.  It only returns the layer like this "2b10ed91bc574d96a5016cfa9c474d35" not like this "18d0e99c4b4-layer-14" so I don't think I can get the pop up configuration for my results, only the layer service itself.  I have tried every expression I can think of in the Get Layer activity, and I cannot get the map layer, only the service layer.  Any advice appreciated.

    Thank You!

     

    0

Du måste logga in om du vill lämna en kommentar.