Custom Picker field(1st filter) filter is not working properly when performing multiple search using check/uncheck the checkbox (2nd filter)

Certified Associate Developer

Hi Experts,

I have 2 filters, one is custom picker EMPID and another is checkbox to "Show current month data", below are the steps i am performing to filter the data:

->Uncheck the check box & then search for an EMPID which is not of current month so that EMPID result shows up

->Now check the "Show current month data" check box & so that the search result cleared off 

->Again search for the same EMPID number & no result found shows up in when its checked (Working as expected as its not current month EMPID,)

->Uncheck the "Show current month data" check box & then search again for same EMPID

   No result found even after page refreshes with  "Show current month data" check box unchecked

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Can you provide some code snippets you use?

  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    I am using CustomPicker Interface inside main interface :

    rule!CustomPicker(
    pickerLabel: "Emp Id",
    labelPosition: "JUSTIFIED",
    placeholder: "--- Search EMP ID ---",
    maxSelections: 1,
    identifiers: touniformstring(local!empIDFilter),
    choiceLabels: touniformstring(local!empIDFilter),
    selectedValue: touniformstring(local!empId),
    saveInto: {
    local!empId
    }
    )

    rule!CustomPicker

    a!pickerFieldCustom(
      label: ri!pickerLabel,
      labelPosition: ri!labelPosition,
      required: ri!isRequired,
      placeholder: ri!placeholder,
      instructions: ri!instructions,
      maxSelections: ri!maxSelections,
      readOnly: ri!isReadOnly,
      requiredMessage: ri!requiredMessage,
      helpTooltip: ri!helpTooltip,
      validations: ri!validations,
      disabled: ri!isDisabled,
      showWhen: ri!isShowWhen,
      suggestFunction: rule!CustomPickerSuggestion(
        filter: _,
        labels: ri!choiceLabels,
        idenifiers: ri!identifiers
      ),
      selectedLabels: if(
        count(
          if(
            isnull(
              ri!type
            ),
            wherecontains(
              ri!selectedValue,
              ri!identifiers
            ),
            wherecontains(
              cast(
                ri!type,
                ri!selectedValue
              ),
              cast(
                ri!type,
                ri!identifiers
              )
            )
          )
        )<1,
        null,
        a!forEach(
          items: ri!selectedValue,
          expression: 
          rule!getArrayPickerLabel(
            identifier: tostring(fv!item),
            labels: touniformstring(ri!choiceLabels),
            identifiers: touniformstring(ri!identifiers)
          )
        )
      ),
      value: if(
        count(
          if(
            isnull(
              ri!type
            ),
            wherecontains(
              ri!selectedValue,
              ri!identifiers
            ),
            wherecontains(
              cast(
                ri!type,
                ri!selectedValue
              ),
              cast(
                ri!type,
                ri!identifiers
              )
            )
          )
    
        )>0,
        ri!selectedValue,
        null
      ),
      saveInto: {
        a!save(
          ri!saveInto,
          rule!ArrayPickerRemoveDuplicate(
            array: save!value
          )
        ),
        ri!additionalSave
      }
    )

    rule!CustomPickerSuggestion

    with(
      local!matches: where(
        apply(
          search(
            ri!filter,
            _
          ),
          ri!labels
        )
      ),
      'type!{http://www.appian.com/ae/types/2009}DataSubset'(
        data: index(
          ri!labels,
          local!matches,
          {}
        ),
        identifiers: index(
          ri!idenifiers,
          local!matches,
          {}
        )
      )
    )

    rule!getArrayPickerLabel

    index(ri!labels,wherecontains(ri!identifier,ri!identifiers),{})

Reply
  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    I am using CustomPicker Interface inside main interface :

    rule!CustomPicker(
    pickerLabel: "Emp Id",
    labelPosition: "JUSTIFIED",
    placeholder: "--- Search EMP ID ---",
    maxSelections: 1,
    identifiers: touniformstring(local!empIDFilter),
    choiceLabels: touniformstring(local!empIDFilter),
    selectedValue: touniformstring(local!empId),
    saveInto: {
    local!empId
    }
    )

    rule!CustomPicker

    a!pickerFieldCustom(
      label: ri!pickerLabel,
      labelPosition: ri!labelPosition,
      required: ri!isRequired,
      placeholder: ri!placeholder,
      instructions: ri!instructions,
      maxSelections: ri!maxSelections,
      readOnly: ri!isReadOnly,
      requiredMessage: ri!requiredMessage,
      helpTooltip: ri!helpTooltip,
      validations: ri!validations,
      disabled: ri!isDisabled,
      showWhen: ri!isShowWhen,
      suggestFunction: rule!CustomPickerSuggestion(
        filter: _,
        labels: ri!choiceLabels,
        idenifiers: ri!identifiers
      ),
      selectedLabels: if(
        count(
          if(
            isnull(
              ri!type
            ),
            wherecontains(
              ri!selectedValue,
              ri!identifiers
            ),
            wherecontains(
              cast(
                ri!type,
                ri!selectedValue
              ),
              cast(
                ri!type,
                ri!identifiers
              )
            )
          )
        )<1,
        null,
        a!forEach(
          items: ri!selectedValue,
          expression: 
          rule!getArrayPickerLabel(
            identifier: tostring(fv!item),
            labels: touniformstring(ri!choiceLabels),
            identifiers: touniformstring(ri!identifiers)
          )
        )
      ),
      value: if(
        count(
          if(
            isnull(
              ri!type
            ),
            wherecontains(
              ri!selectedValue,
              ri!identifiers
            ),
            wherecontains(
              cast(
                ri!type,
                ri!selectedValue
              ),
              cast(
                ri!type,
                ri!identifiers
              )
            )
          )
    
        )>0,
        ri!selectedValue,
        null
      ),
      saveInto: {
        a!save(
          ri!saveInto,
          rule!ArrayPickerRemoveDuplicate(
            array: save!value
          )
        ),
        ri!additionalSave
      }
    )

    rule!CustomPickerSuggestion

    with(
      local!matches: where(
        apply(
          search(
            ri!filter,
            _
          ),
          ri!labels
        )
      ),
      'type!{http://www.appian.com/ae/types/2009}DataSubset'(
        data: index(
          ri!labels,
          local!matches,
          {}
        ),
        identifiers: index(
          ri!idenifiers,
          local!matches,
          {}
        )
      )
    )

    rule!getArrayPickerLabel

    index(ri!labels,wherecontains(ri!identifier,ri!identifiers),{})

Children