How to search values within constans

Certified Associate Developer

Hi All,

I have a use case where we have to search for values in numerous constants if it matches a specific email domain. Just applying the search box value isnt productive as it doesnt provide the results with actual constant values, also gives descriptions which is not useful in my case. 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Could you make an expression rule like below that builds up array of keys and values with x number of constants: 

    a!localVariables(

    local!allEmails: flatten({ local!const1, local!const2, local!const3 }),

    local!dictArray: a!forEach( items: local!allEmails, expression: a!map( key: "Email_" & fv!index, value: fv!item ) ), 

    keys: local!dictArray.key,

    values: local!dictArray.value

    )

    And add a foreach to check fv!item for:   any(fn!contains(local!dictArray, "mydomain.com"))

Reply
  • 0
    Certified Senior Developer

    Could you make an expression rule like below that builds up array of keys and values with x number of constants: 

    a!localVariables(

    local!allEmails: flatten({ local!const1, local!const2, local!const3 }),

    local!dictArray: a!forEach( items: local!allEmails, expression: a!map( key: "Email_" & fv!index, value: fv!item ) ), 

    keys: local!dictArray.key,

    values: local!dictArray.value

    )

    And add a foreach to check fv!item for:   any(fn!contains(local!dictArray, "mydomain.com"))

Children
No Data