Contains formula
What is the formula to display something if it contains a certain text in that field?
8 replies
-
Wow!
-
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?
-
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.
-
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' = txtbut 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.
-
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))]
-
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.
-
Whenever I put contains, it shows that the function is not defined.
how can I define it?Thanks
-
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
- 4 yrs agoLast active
- 8Replies
- 3723Views