Zum Hauptinhalt gehen

Get selected items from checkbox form

Kommentare

5 Kommentare

  • Permanently deleted user

    I assume you're working with the Check Group form item rather than invididual Check Box items, since you mentioned it's populated from a query, but let me know if that's not the case.

     

    With the Check Group form item, you can get the state of each checkbox like this:

    $form1.state.checkGroup1.items[0].checked 

    $form1.state.checkGroup1.items[1].checked 

    etc.

     

    If you want to grab values from all the boxes in a checkgroup at once, you could do something like this:

    1. use Create Value to make a value that will hold your checked items
    2. add a For Each activity to loop through each item in the check group
    3. Inside the For Each, use an If activity to see if the individual checkboxed is checked or unchecked.
    4. If it's checked, add it to the value from step 1
    5. After the For Each activity, do something with that filled in list of checked items (eg, run a new query)

    Example here: https://latitudegeo.maps.arcgis.com/home/item.html?id=e00e0da0d9fc45369bdae21b5835aa88

    1
  • Permanently deleted user

    Thank you for this example, Amanda! This was exactly what I needed :)

    0
  • Eric Kriener

    @Amanda Frech? why can't I access this sample? thx.

    0
  • Permanently deleted user

    @Eric Kriener? Try signing into workflow designer using your normal bookmark/url. Then use File > Open by Url, and paste the URL.

    Not all users can open workflows by clicking the launch button from the ArcGIS Online page, because some organizations have access to the on-prem version of workflow instead of the cloud apps.geocortex.com version.

     

    I should also mention that this post is a couple years old, and newer versions of workflow have a built-in property that returns just the "checked" items from a checkgroup. So if you use =$form1.state.checkGroup1.value.items as the input on the ForEach activity instead of =$form1.state.checkGroup1.items, you can safely remove the "If" activity inside the ForEach.

    0
  • Eric Kriener

    awesome. I got in to it and I'll check it out. thanks for the new tip as well!

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.