Subject: RE: @dblookup key
What is the first sorted column in your view (whether visible or hidden)? What is the formula for this column? Can you see the values in the view? Are they the values of your key?What’s the value of the key you’re looking up? Can you prove it by using @Prompt to display its value prior to the lookup? This will also show when your formula is running, which might not be happening when you think it is. Specifically, you could use the following formula:
@Prompt([ok]; “Key lookup”; “key = <” + @Implode(@Text(ProjectNameTX); "; ") + “>”);
@If(ProjectNameTX = “”; @Return(“”); “”);
_tmp := @DbLookup(“”; “Notes1”:“Engineering\EngineeringCombo.nsf”; “Project Time”; ProjectNameTX; 2);
@Prompt([ok]; “Lookup result”; “<” + @Implode(@Text(_tmp); "; ") + “>”);
@IfError(_tmp; “No match found”)
What’s the formula for column 2 of the view, which you are trying to retrieve?
Use the document properties infobox from the view to display the field values of the one document that you believe matches your key. The field values are displayed on the 2nd tab. Find the field that’s displayed in column 2 of the view. What values does it contain?
Right now, the formula is returning a list of ALL of the values stored in the 2nd column of the view(separated by a semi-colon).
The @Prompt statements will show when the formula is actually executing. Right now, the top possibilities are:
The formula is not executing because the field already has a value. Until you have the document in edit mode and either refresh (F9) or try to save, it will not be recalculated.
ProjectNameTX actually contains a list of all the project names.
Your lookup is returning data from one document, which happens to contain multiple values in the field you’re looking up.
I swear to you that there is no way @DbLookup is returning data from more documents than the number of keys that you pass to it.