lookup
Using [lookup] in your template performs an extremely fast search through the specified database and returns either the value of the returnField in the found record, or the literal text of the notFound value. The search is a case-sensitive, exact match, so "Apple" does not equal "apple." If you want more control over the search criteria, use a [search] context instead.
[lookup db=mydata.db&value=46283&lookinfield=PROD_ID&returnfield=PROD_NAME¬found=We do not have this product]
Parameters
Parameter | Description |
---|---|
db | Path and name of the databse |
value | The reference value |
lookinfield | The field to match the reference value |
returnfield | The value of the field that is required |
notfound | A message or value or further WebDNA code to use if the 'value' is not found |
You can specifiy a WebDNA table, in place of a database file.
ie: [lookup table=TableName&...].
[lookup] is about 40 times faster than [search]. Using several [lookup] to recover data from your databases may be faster than a single [search]