Hoppa till huvudinnehållet

Studio: Web Viewer - Run workflow from a web map popup possible?

Kommentarer

4 kommentarer

  • Jenny Oh

    I am looking for a solution to run a workflow from a url in the popup as well.

    Have you figured it out? 

    We have popups as well but the link no longer works. Instead I see a tab with the default Capital City app.

    1
  • Tyson Schoepflin

    2023-10-17

    Another thread had mentioned they basically built their own popup replacement with a workflow.  I wasn't thrilled about that but in the end that is what we are using for now.  Our solution works because we have a single layer of interest for a custom popup, this method would need to be expanded upon to handle multiple layers.  That said this method does have a button in the workflow that brings up the default maptip so it can still be accessed beyond our custom popup.

    Web Viewer
    Place a "Panel" component just below "Result Summary" in the "Map" component.  Add a "Workflow" component to the panel, this will be the target for the map event.

    Expand "Events" on the "Map" component and edit the Map Clicked event to a custom command with this content.  I believe the id needs to match the workflow component added in a step above and the target must match that component layout id.  Those values can be found by pressing the gear icon when a component is selected in the designer.

    [
        "tasks.identify",
        {
            "name": "workflow.run",
            "arguments": {
                "icon": "workflow",
              "title": "my title",
                "id": "bd141967-61ca-4e7e-b0df-62cc2f4038f5",
              "portalItem": "https://portal.somesite.com/arcgis/sharing/rest/content/items/yourWorkflowPortalIDHere",
                "target": "workflow-4b468995",
                "commandArgumentInput": "context",
                "inputs": {}
            }
        }
    ]


    Workflow
    The workflow will have a input of context which is used to discover a layer of interest.

    $getWorkflowInputs1.inputs.context

    Next loop over that context and find a source.layer of interest.  We use source.layer.title to discover if the custom workflow form will be displayed or not.

    If the layer of interest is not included in the context the workflow runs the "results.display-summary" command and passes the context along to it.

    If the layer is found the item is pulled out using a to json > parse json > get geometry sequence to get the feature and the geometry.  Graphics and a display form can then be used to show the selected feature and attributes from the feature can be used to populate various form elements.  All this to have a user optional "Run Report" button in the popup that launches a report if they desire.

    Finally, we added a button in the form called "View Other Features" which just runs the "results.display-summary" command with the input context.

    Hope that helps.  It isn't a solution that really handles multiple layers with a single popup, but you can have custom popups (different workflow display forms) for specific target layers.

    1
  • Jenny Oh

    Thank you for the detail response. I really appreciate it. I am really bum out that there is no parity for this.

    I am going to try a different method. Under the "Result Details", Feature Actions,Add Menu Item, I can add a command, workflow or report. I will call a workflow from there.

    Get the feature  from $getWorkflowInputs.inputs.context[0] . Hopefully it will work for me.

    0
  • Marion Bishop

    I am using the process outlined here to run a workflow and get input values. In this case I add a startup workflow with an empty ParseURL. The empty ParseURL will read the url of the viewer as its input.

    The url is something like this: https://Server/vertigisstudio/web/?app=xxxxxx&RunWorkflowByUrlAndInputs?url=https://Server/portal/home/item.html?id=xxxxxxxx&foo=ABCDE&bar=XYZ

    I am launching a separate web viewer from a web map pop up so this may not be 100% what you need.

     

    0

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