Skip to main content
lalithap7428
April 11, 2023
Question

How to show a tooltip on custom picker items.

  • April 11, 2023
  • 7 replies
  • 0 views

My use case is after I search for a text, when I mouseover on the results even before selecting the item, it should display relevant information about the item.

    7 replies

    April 11, 2023

    It is not possible to show tooltip when hovering on suggestions. You can use selectedTooltip parameter to pass any information which will be displayed on hovering over selected items.

    Or you can pass different arrays in suggestFunction and selectedLabels which will show different label for suggestions and different for selected items

    lalithap7428
    April 11, 2023

    Thanks Sanchit. Can you please share sample code for the second suggestion.                                                        

    April 11, 2023

    You will get the code in the custom picker documentation

    link: Configure an Array Picker that Ignores Duplicates

    Just update the main interface by adding a new local like this:

    a!localVariables(
      local!pickedStates,
      local!stateLabelsWithDesc: {
        "Alabama (southeastern U.S. state thatâ`™s home to significant landmarks from the American Civil Rights Movement.)",
        "Alaska (U.S. state on the northwest extremity of North America) "
      },
      local!stateLabels: { "Alabama", "Alaska" },
      local!stateAbbreviations: { "AL", "AK" },
      {
        a!pickerFieldCustom(
          label: "States",
          instructions: "Select up to three desired office locations",
          maxSelections: 3,
          /*
          * To use with your data, replace local!stateLabels with the datapoint  you wish to be displayed and 
          * local!stateAbbreviations with the datapoint you eventually want to save. 
          */
          suggestFunction: rule!PA_arrayPicker(
            filter: _,
            labels: local!stateLabelsWithDesc,
            identifiers: local!stateAbbreviations
          ),
          selectedLabels: a!forEach(
            items: local!pickedStates,
            expression: index(
              local!stateLabels,
              wherecontains(fv!item, local!stateAbbreviations)
            )
          ),
          selectedTooltips: a!defaultValue(local!pickedStates, null),
          value: local!pickedStates,
          /* The union() function allows duplicate states to be ignored, returning only unique elements.*/
          saveInto: a!save(
            local!pickedStates,
            union(save!value, save!value)
          )
        )
      }
    )

    mikes0011
    Brainy
    April 11, 2023

    Please contact Appian to see if they will put an enhancement request in their dev backlog, because I agree this would be handy to have.  Another thing I've long wanted in the suggestion pop-ups (and the eventual item label as well) is the ability to consume Rich Text - adding things like icons, formatting, sizing, etc.  My most concrete use case would be to have the "primary" label in one row, then a second row containing small italicized text with further details.

    The Expression Guru
    stefanhelzle0001
    Brainy
    April 11, 2023

    A quick teaser to my next blog post: How to format non-formatable text in Appian!

    mikes0011
    Brainy
    April 11, 2023
    How to format non-formatable text in Appian

    that's one i'll read.  Give me a hint though, does it involve using extended ASCII character codes / etc?

    The Expression Guru