I’m trying to find a way to suggest casefiles that can be linked to attachments based on the attachment name.
Each attachment has some keywords extracted
Each casefile also has some keywords extracted
I’ve created a column “Matching casefiles #2” that iterates through all the records from the casefiles… and tries to find matches between the keywords from the DB Casefile and the keywords from the current attachment.
It gives me for each db casefile that exists a list of true’s and false’s (match keywords).
I just created a new column named ‘Matching casefiles #3’.
I’m not sure if there are more efficient formulas that can achieve your requirements, but this is a very expensive one. If the number of items increases even only moderately, the document will probably become very slow.
If that’s the case you should consider moving the logic to a button or automation and run it only when needed. For example, when a ‘Casefile’ is modified.
[DB Casefile].ForEach(
List(
CurrentValue,
CurrentValue.Keywords.Filter(
thisRow.Keywords.Contains(CurrentValue)
).Count()
)
).WithName(
lst,
/*List of lists with all the Casefiles and the number of matches with the current attachment*/
lst.ForEach(CurrentValue.Last()).Max().WithName(
max,/*Max number of matches per Casefile*/
lst.Filter(CurrentValue.Last()=max).ForEach(CurrentValue.First())
/*List with number of matches equal to max*/
)
)
Hard to tell if it will be an issue or not, depends on many factors. Just try it out and keep in mind the option of moving the logic to a button if it gets too slow!
I asked DeepSeek to take a look at your formula and see if it can optimise performance… i’m not to determine that it did, but I wanted to share it with you…
here’s what it came up with: