google-appsheet

Automatic Lookup Across Tables in AppSheet


Hi I'm having a problem with looking up data on another table with AppSheet Basically, when I scan in a barcode, I want the product name to lookup such that in SQL

SELECT productName
FROM productLookupTable
WHERE productLookupTable.barcode == the_scanned_barcode

However, I can't seem to do this in appsheet. I tried

LOOKUP([barcode],'productLookupTable','barcode','productName')

as the formula for the product name field in the add view and that didn't work either. Scanning a barcode didn't trigger a lookup, or it says match not found. (Two different scenarios of many combinations of things I tried.)

Any help would be appreciated.


Solution

  • I was almost there. I had to use

    LOOKUP([_Thisrow].[barcode],'productLookupTable','barcode','productName')
    

    the key part is

    [_Thisrow]
    

    Then it worked perfectly.