dropdown search box find incorrect values

Certified Senior Developer

Hi,

I am using a dropdown with values retrieved from a record. The record only has the identifier field and a text field. The issue is that when using the search option, it finds values that do not match exactly what is typed in the dropdown search box.

For example, I type part of the name of one of the records ("real") and it correctly shows only one matching result, "LOREAL EUROPE SUCURSAL ENESPAÑA." However, if I add one more letter ("reald"), the results change and show two results that do not exactly match what I am looking for: "INDUSTRIA CORE ESPAÑOLA DE MODA" and "NEW ERA REMARK LIMITED". I understand that it shows these values due to the following,

"INDUSTRIA CORE ESPAÑOLA DE MODA" and "NEW ERA REMARK LIMITED". If I add an "a" -> "realda", it only shows "INDUSTRIA CORE ESPAÑOLA DE MODA".

Isn't there a way for it to search only for results that exactly contain what I am typing?

Thank you very much.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer

    Hi  ,

    You can try with custom picker field. It will solve your issue.

    rule!TR_Test()

    a!localVariables(
      local!data: {
        "LOREAL EUROPE SUCURSAL ENESPAÑA.",
        "INDUSTRIA CORE ESPAÑOLA DE MODA",
        "NEW ERA REMARK LIMITED",
        
      },
      local!result: if(
        a!isNotNullOrEmpty(ri!txt),
        where(
          a!forEach(
            items: local!data,
            expression: search(ri!txt, fv!item)
          )
        ),
        ""
      ),
      local!outdata: index(local!data, local!result, null),
      a!dataSubset(
        data: local!outdata,
        identifiers: local!data
      ),
      
    )

    a!localVariables(
      local!value,
      {
        a!pickerFieldCustom(
          label: "Custom Picker",
          labelPosition: "ABOVE",
          placeholder: "search",
          suggestFunction:rule!TR_Test(txt:  _,),
          selectedLabels: local!value,
          value: local!value,
          saveInto: local!value,
          validations: {}
        )
      }
    )

Reply
  • 0
    Certified Associate Developer

    Hi  ,

    You can try with custom picker field. It will solve your issue.

    rule!TR_Test()

    a!localVariables(
      local!data: {
        "LOREAL EUROPE SUCURSAL ENESPAÑA.",
        "INDUSTRIA CORE ESPAÑOLA DE MODA",
        "NEW ERA REMARK LIMITED",
        
      },
      local!result: if(
        a!isNotNullOrEmpty(ri!txt),
        where(
          a!forEach(
            items: local!data,
            expression: search(ri!txt, fv!item)
          )
        ),
        ""
      ),
      local!outdata: index(local!data, local!result, null),
      a!dataSubset(
        data: local!outdata,
        identifiers: local!data
      ),
      
    )

    a!localVariables(
      local!value,
      {
        a!pickerFieldCustom(
          label: "Custom Picker",
          labelPosition: "ABOVE",
          placeholder: "search",
          suggestFunction:rule!TR_Test(txt:  _,),
          selectedLabels: local!value,
          value: local!value,
          saveInto: local!value,
          validations: {}
        )
      }
    )

Children