Skip to main content

Add feature scenario

Comments

3 comments

  • Ken Lyon

    Moved to this topic as it's more relevant for troubleshooting questions rather than ideas for new features.

    0
  • Belinda Kerr

    Hi,

    This is also a common scenario for us when we want the public to submit information but it cant be seen by the public for privacy reasons. My approach is to have the basic information layers in the map to give users the context they need, but not the one you are editing.

    Depending on how you want to initiate the adding of a new feature (or table record) how you start the editing process may be different, but say you want someone to add a new pot hole location  - you could start the editing using a button somewhere in your app. When they click the button, it will then launch a workflow.

    Use the workflow to show the form for what you want to collect, including any geometry information. When the form is complete and the user submits it, use the workflow to then submit the new feature information (create feature activity) to a separate feature service item (not shown in the map). You would of course want the feature service to be secured so the information cant be accessed.

    Belinda

    0
  • Ken Lyon

    Nabaz Gharib Mohammed, Belinda Kerr

    It is by design that our workflow activities use the access token of the currently logged in user when performing operations such as Add Features. However, there is a workaround that might allow what you are describing but it would involve a Server Workflow.

    In your existing client workflow, where you are using the Add Features activity, change it to use the Run Workflow activity to run a server workflow. You should pass in the feature(s) as inputs. You should probably convert them to JSON beforehand. It might also be helpful to pass in the url of the feature service so that it doesn't need to be hard-coded in the server workflow.

    In the server workflow, use the Generate ArcGIS Token activity for the admin account. (Note that this requires a username and password as inputs, but there are ways to secure this as server workflows are only saved on your own server.) Once you have an access token, you can then use the Send Web Request activity in the server workflow to perform the Apply Edits operation on the feature service layer.

    This involves a little more work as the Add Features activity would normally generate the correct web request for you, but when using a server workflow you need to do so manually. For license reasons, we are not able to use Esri's own API in a server context, so the generic Send Web Request activity is the only option.

    1

Please sign in to leave a comment.