Zum Hauptinhalt gehen

Can you use the value from an autoComplete box in a query?

Kommentare

4 Kommentare

  • Permanently deleted user

    Hi Ali,

     

    When you use the Autocomplete box, are you typing the full text and then clicking submit, or are you typing a few characters, selecting an option from the suggestions list, and then clicking submit?

     

    The .value property only contains a value if you've selected an item from the suggestions list. It corresponds to the Value Field Name from the Get Form Element Items From Features activity inside the Autocomplete's suggestions subworkflow.

     

    If you type text into the Autocomplete box and then don't use the suggestions list, you can still get that text from the .label property instead. Ie, $form1.state.autoComplete1.label

    0
  • Ali VanSickle

    Thanks Amanda for the reply. Yes I was aware of this difference. If I type in the AutoComplete and do not use a suggestion, and I change my workflow to use $form1.state.autoComplete1.label then it works.

     

    If I am selecting from the suggestion list and use $form1.state.autoComplete1.value in my query it fails.

    0
  • Permanently deleted user

    I wonder if it might have something to do with the way the values are populated then in the subworkflow for the Autocomplete suggestions. For example, maybe we're missing something on the "Output Fields" or "Value Field Name" properties. If it looks good in the workflow, I'd recommend tossing in some log activities to double check the values from the Query Layer and Get Form Element Items From Features activities.

    Eg,

    Log: =$query1

    Log: =$formElementItems1

     

    Then check your browser console logs when you use the autocomplete and see if the problem can be traced back that far or not.

    Or if your service is public you could share the workflow so we can take a look.

    0
  • Ali VanSickle

    Thanks Amanda! That was the issue. I had the Value Field Name incorrect.

     

    My workflow works well now.

    Thanks!

    0

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