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
  • 0
    Certified Lead Developer

    What do you mean with "ignore"?

    What result do you expect when searching like this?

    You could try to split the search term by the dash symbol and then combine two filters in an AND.

  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    Please help me on this ....Here we getting the result after entering into the the assignment number with hypen like this 6430-860726425, But i need same result  without hypen also 6430860726425 .... After not searching or not adding hypen in the search field also result should come .

    6430860726425 .... After not searching or not adding hypen in the search field also result should come 

  • 0
    Certified Lead Developer
    in reply to Royal

    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.

  • 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..

  • Then I would suggest a DB view that strips out the hyphens in whatever way you deem appropriate, and your searches can run against that column (for the user-side, you can allow them to enter dashes or not, and pass the stripped-of-hyphens text to the actual search filter, searching against the View Column that also has hyphens stripped). 

    Beyond that, and we're kinda getting into "magic wand requirements" territory - that is to say, you're expecting the system to do something "intuitive" that it has no logical reason to know to try doing.

  • 0
    Certified Lead Developer
    in reply to Mike Schmitt
    Beyond that, and we're kinda getting into "magic wand requirements" territory - that is to say, you're expecting the system to do something "intuitive" that it has no logical reason to know to try doing.

    You made my day! Thanks  

Reply Children