Hoppa till huvudinnehållet

Not able to retrieve feature attributes

Kommentarer

12 kommentarer

  • Bryan Bingham

    Hi Yannik,

    You'll need to convert your workflow inputs to a graphic in order for them to work in Mobile.  If you add a ‘Run Operation’ activity to your workflow with a Operation Name of ‘results.to-graphics’ and the operation parameter of ‘$getWorkflowInputs1.inputs.context’ you should then see an object where you can query the object ID from $getWorkflowInputs1.inputs.context[0].attributes["OBJECTID"]. 

    1
  • Bryan Bingham

    Going step by step:

    • Use the get layer activity, this will get all of the layer information (token, schema, url, etc.) that a bunch of follow on activities in the workflow are going to need.  There's a Get Table activity for GDB objects that are a table (no spatial data). In the Layer Id box, enter in the name of the layer from your AGOL/Portal web map with no quotes
    • Connect the Get Workflow Inputs activity, there are no arguments for this activity
    • Connect the Run Operation activity, set the input arguments to the following, the operation parameter will be the context object from the get workflow inputs (=$getWFInputs.inputs.context) 
    • Attach the Query Layer activity and specify the following inputs, you can also use this activity to do some more advanced querying based on geometry and other spatial operations:
      • Layer - =$CulvertLyr.layer
      • Where - =$getWFInputs.inputs.context.attributes["OBJECTID"]
      • Return Geometry - True (this will return the geometry from the feature layer)
      • Output
      •  Fields - * (this will return all fields in the service; If you want to limit the return, you can use the field names separated by a comma)

    When you save and run this workflow, the result back from the query layer should be a feature that you can then work with, I would usually use a display form to load the query results to let users update the data.

    1
  • Yannik Bäder

    Thank you very much Bryan! Now the Object-ID is passed through!

    Unfortunately the Query Layer activity gives me all polygons. Logging $query2.features.length is 4 in my case. Maybe the Where-Clause is incorrect: =$getWorkflowInputs1.inputs.context[0].attributes["OBJECTID"]? If I log this, I receive the correct number.

    Do you know what's wrong here?

    0
  • Bryan Bingham

    I think I messed up the Where clause; if you're still looking for the object id, try this in the where clause of the query activity: =$'ObjectID = '+$getWorkflowInputs1.inputs.context[0].attributes["OBJECTID"].  

    0
  • Yannik Bäder

    No unfortunately no progress:

    0
  • Bryan Bingham

    lose the $ after the equal sign and before the '

    1
  • Yannik Bäder

    That did the trick! Thanks a lot!

    0
  • Yannik Bäder

    Hi Bryan Bingham ,

    I have another issue similar to the one above. Still using VertiGIS Studio Mobile.

    I try to add default values to some attributes of new features drawn and added by the user in the app. So I followed the steps documented here: https://developers.vertigisstudio.com/blog/2023/03/01/mobile-generic-event-listener/ . Instead of layer.visibility-changed I use edit.feature-added. Is this the easiest way to do it?

    Unfortunately I am not able to get the feature as an input like it is described in this section. In the workflow which is (successfully) invoked by the event, I added “Get Workflow Input” and for developing reasons a Log-Activity. Therein I tried:

    $getWorkflowInputs1.inputs.context
    $getWorkflowInputs1.inputs.context[0]
    $getWorkflowInputs1.inputs.context.Feature

    … and many more. I can see in the protocol, that the context is undefined. As an argument I receive “vertigis.arcgisextensions.data.feature”.

    I also tried to convert the input in a graphic like you proposed in the issue above - no success.

    I hope you can help me.
    Thanks in advance!
    Yannik

    0
  • Yannik Bäder

    Like this?

     

    Log Result:

    Is it possible that the feature is not transferred correctly to the workflow?

    0
  • Zack Robison

    It's possible, but unlikely.  What does the debugger tell you about the getInputs result?

    For reference: https://docs.vertigisstudio.com/workflow/latest/help/Default.htm#wf5/help/logging.htm#turn-on-verbose-logging-in-gxm 

    0
  • Yannik Bäder

    This is the result of the Get Workflow Inputs-Activity:

    System.Collections.Generic.Dictionary`2[System.String,System.Object]

    0

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