Description:
When using lookup() in formulas, you cannot perform element-wise arithmetic operations on the returned arrays. For example:
lookup(‘link’, ‘price’) * lookup(‘link’, ‘quantity’)
Steps to reproduce:
- Create a Formula field that attempts to multiply two lookup arrays:
lookup(‘Orders’, ‘Price’) * lookup(‘Orders’, ‘Quantity’)
Error occurs:
“argument number 2 given to operator / was of type number but there are no possible types usable here”
Expected behavior:
Support element-wise operations on lookup arrays, similar to how other database/spreadsheet tools handle array formulas, OR provide a function like array_map() to apply operations across array elements.
Example use case:
Calculate total commission per user by looking up amounts and percentages from linked records and computing:
sum(lookup(‘Commissions’, ‘Amount’) * lookup(‘Commissions’, ‘Percentage’))