Skip to main content
November 22, 2021
Solved

Selection of a text based on the passed value

  • November 22, 2021
  • 2 replies
  • 0 views

Hi Appian experts,

Here, I am trying to get the cText based on the passed typeId.

How I can achieve this.

a!localVariables(
local!selectedtype: "IM",
local!myDictionary: {
{ cText: "Internal Memo", typeId: "IM" },
{ cText: "External Memo", typeId: "EM" },
{ cText: "Correspondence", typeId: "CP" }
},
local!myDictionary.cText[local!selectedtype]
)

Best answer by stefanhelzle0001

Give the displayvalue() function a try.

a!localVariables(
  local!selectedtype: "IM",
  local!myDictionary: {
    { cText: "Internal Memo", typeId: "IM" },
    { cText: "External Memo", typeId: "EM" },
    { cText: "Correspondence", typeId: "CP" }
  },
  displayvalue(
    local!selectedtype,
    local!myDictionary.typeId,
    local!myDictionary.cText,
    null
  )
)

2 replies

stefanhelzle0001
Brainy
November 22, 2021

Give the displayvalue() function a try.

a!localVariables(
  local!selectedtype: "IM",
  local!myDictionary: {
    { cText: "Internal Memo", typeId: "IM" },
    { cText: "External Memo", typeId: "EM" },
    { cText: "Correspondence", typeId: "CP" }
  },
  displayvalue(
    local!selectedtype,
    local!myDictionary.typeId,
    local!myDictionary.cText,
    null
  )
)

November 22, 2021

Perfect solution. Great. Thank you.