0

Contains formula

What is the formula to display something if it contains a certain text in that field?

8 replies

null
    • Sean
    • 5 yrs ago
    • Reported - view

    Wow!

    • SMoore
    • 5 yrs ago
    • Reported - view

    For example. If I have a text box that is named Search and then a table View in my form, when I type in the search, I would like to display the closest match to the field I am searching.

     

    SO I would assume something like this

     

    if Search contains ### then 

     

    How do I achieve this?

    • Sean
    • 5 yrs ago
    • Reported - view

    Is the table View searching the same table that the view is on? This is what I came up with and you have to press tab or return to activate the view update.

     

    let myText := Text;
    (select Table1)[contains(Text, myText)]

    Goes in the formula field.

    • SMoore
    • 5 yrs ago
    • Reported - view

    It is not in the same table. I have a separate dashboard. This is what I’ve came up with 

     

    let txt := 'Repair Number or Serial Number';
    select Repair where 'Repair Number' = txt or Device.'Serial Number' = txt

     

    but it only returns my search if what I type is exactly, down to case sensitivity. I am just trying to figure out how to implement contains, where it doesn’t have to be exact. 

    • Sean
    • 5 yrs ago
    • Reported - view

    This works so you'll just have to rename the items that don't match your names.

     

    let yourSrch := yourSearchField;
    (select Table2)[contains(upper('Repair Number'), upper(yourSrch)) or contains(upper('Serial Number'), upper(yourSrch))]

    • Sean
    • 5 yrs ago
    • Reported - view

    You can also use if-then-else to test for null on the search field and if it is null just use select yourTable to display all records.

    • BNV_Tec
    • 3 yrs ago
    • Reported - view

    Whenever I put contains, it shows that the function is not defined.
    how can I define it?

    Thanks

    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    Maria,

    I think you're using a field in your contain statement?

    So if you use something like this: contains(Field,"123")

    You will get that error if the field is a number field.

    You could change the formula to this to get it working: contains(text(Field),"123")

    Steven

Content aside

  • 3 yrs agoLast active
  • 8Replies
  • 3606Views