Skip to main content

populate dropdown list from a non spatial database table

Comments

4 comments

  • Permanently deleted user

    Hi there,

    There are at least four ways to populate a dropdown list in Workflow.

    First, there's the easiest way - by specifying the items directly in the form editor.  This is best for items that will never change, where we only have a few.  That's the Add / Remove Items when a ComboBox is selected in the form editor.

    Second, we can connect the combo box up to an ArcGIS Server REST endpoint.  To configure the combo box to do this, fill out the details in the "Query Details" region in the ComobBox property editor.  Results from the can be used for both the Display Field and Value Field.

    Third, we can generate a "DataItem List" outside the form activity, and assign it to the ComboBox's "Input Data" value.  There are currently three workflow activities that can create a DataItem List, located in the Conversion section: DataTable to DataItem List, FeatureSet to DataItem List, and List to DataItem List.  A DataItem object contains a Display and Value field that will be used to display form elements; when you create a list of them, you configure the activity to extract values from the source structure as appropriate.  See the built-in help for the conversion activities for more information.

    Note: you can also generate individual DataItem objects, and then put them in a list manually.

    Finally, we can assign the DataItems or Query parameters dynamically in the form's RuntimeModifications sequence.  This will work very close to what the query task / data item list population does, except that we can change the behaviour at runtime.  This allows you to use a workflow variable to set any of the properties for the query task, it's not usually used to set the DataItems directly as those can be access via the Input Data fields.

    For your workflow, I suggest using a sequence as follows:

    1. A SqlQuery activity to select the assets from the database.  The result will be a DataTable.
    2. A DataTable to DataItem List activity to extract combo box items from the DataTable.
    3. Set the Input Data field for ComboBox1 to be the resulting IList<DataItem> from the previous activity.

    Regards,

    -Malcolm

    0
  • Permanently deleted user

    Malcolm,

      I tried the third option and it worked great.  Thanks a lot!

     

    0
  • Permanently deleted user
    I am trying to assign IList<DataItem> to a combo box or a listbox, but there is no 'Input Data Field' property. 

     

    How can I accomplish this ?

     

    Muhammad Almas
    0
  • Nico Burgerhart
    It is on the activity, not in the form designer.
    0

Please sign in to leave a comment.