Let’s say that I have 2 tables. One table is populated by codes and references from the second table, and the other has an ID field, a lookup from first table (codes), and a third field with text quotes
Second field could include multiple selections, either a code or a list of codes.
I’ll paste an example at the end
If I want to filter using one value from the table using a formula, it works. For instance
I have to go deep into codaese. I would assume that Contains would admit an expression, but you have shown that the expression has to be built with Filter. A little bit more verbose, but nothing serious.
My doubts are solved and the solution is quite, quite useful for a range of needs. Such Code Field can be used as tag for other fields that contains, say, text or images. A temporary formula inside a section can be used for recover the pieces of content that you have tagged with “codes”, using logical operators.
For what is worth, I would like to point out another detail of these kind of formulas.
I have tried to extend the example and show the data in other way. I have created a new table called Non-lookup and lookup from coding into text quotes. I want to list sources in which codes has been used
First column is a raw copy from coding index. Second column is a lookup from coding.CodeName. Third column is this formula:
First conclusion: if we want to look using Contains, both fields have to be of the same type. For instance, you cannot look for a string into a list of references, as third column formula do. You need to look for a reference into a list of references, unless the list of references is a lookup from a field of other table and you are looking for the strings from the looked-up table. Am I right, @Ander ?
Second conclusion: if you use Contains of a reference into a lists of references, you have to refer exactly to the field in which the reference is inserted, no matter if the field is the index of the table. For instance:
I’m unclear on what you’re saying in these two conclusions. Could you please state them a different way, or better yet, put an example of each in your doc?
This new formula works because it compares two instances of the same reference. My first conclusion was that .Filter(field.Contains... cannot compare a string with a field populated with references. The only excepcion to that is if the string belongs to the field to which the list of references is pointing, has happens in Coding.Column 3
My second conclusion is that if you try to filter which rows are Contained into a field built from a lookup (populated by references), it is not possible to filter using just thisRow. You need to precise the specific field of the table that you want to compare (in my example, thisRow.Lookup code) or it won’t work, either if the field is an index or not
I was having trouble putting into words my comments on your conclusions, so I made a new table for you at the top of your doc called: boolean Display column.
multi lookup is a reference to boolean Display column row name . Therefore, multi lookup is going to contain any value of the column that it is pointed to.
However, in my example the only formula that works was the one that both field were references.
I’m not sure how can I express this specific problem in other way. Anyways, your last table has been really nice for learning about other aspect of the problem. I really appreciate it and all your help.