Ignore Hypen while searching in the search grid

Certified Associate Developer

How to ignore hypens while searching in the grid 

In the above image, while searching in the grid after removing hypen also below data needs to be come..

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to gnanaroyal

    So you want to see all items that match the term, either with the included hyphen OR without it. Is that correct?

    As you did not share any code, I can just guess .... you use some sort of query and some queryfilters.

    a!queryFilter(
      field: "assignment",
      operator: "in",
      value: {
        local!assignmentSearch,
        cleanwith(local!assignmentSearch, "0123456789")
      }
    )
    

    That's just a rough idea and you will have to adapt it to your specific situation.

Children
  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    So you want to see all items that match the term, either with the included hyphen OR without it. Is that correct? - Exactly Correct

    Can you please help me to modify the code as i am new to appian

    a!queryFilter(
    field: 'recordType!{04d098b2-3248-430f-a8d0-576e6b244ff9}DA Deduction.relationships.{d9dc528a-1952-491e-9b62-d6a4662e662b}daAccountreceivable.fields.{68eecf21-936d-4035-b635-45496164c6b8}assgnmntNmbr',
    operator: "in",
    value: local!Assignment,
    applywhen: and(
    a!isNotNullOrEmpty(local!Assignment),
    count(local!Assignment) > 1
    )
    ),
    a!queryFilter(
    field: 'recordType!{04d098b2-3248-430f-a8d0-576e6b244ff9}DA Deduction.relationships.{d9dc528a-1952-491e-9b62-d6a4662e662b}daAccountreceivable.fields.{68eecf21-936d-4035-b635-45496164c6b8}assgnmntNmbr',
    operator: "includes",
    value: if(a!isNotNullOrEmpty(local!Assignment[1]),local!Assignment[1], ""),
    applywhen: and(
    if(a!isNotNullOrEmpty(local!Assignment[1]), true, false),
    count(local!Assignment) = 1
    )
    ),

    The above 2 query filters are being used for the assignment picture for your reference also..

  • 0
    Certified Lead Developer
    in reply to gnanaroyal

    I suggest you make a new custom record field which contains the data from "assgnmntNmbr" but strips out everything but digits (or other valid characters beyond hyphens).  Then your query filter can just do an "includes" on the user-entered-text-similarly-stripped and reference that column (but you'll still display the original column and its value-with-hyphens).