language area · Bindings

Lookups and destructuring

lookup names a field read explicitly, with select for the fields, and let { a, b: c } = binds the fields of a projection as locals.

Implementation
Implemented in the compiler, not yet published
Kind
Mynt language, not a SuiteScript method
A

Supported · compiles today

mynt
1let { email, comments: note } = lookup Customer(123)2    select email, comments
suitescriptoutput, trimmed
1const { email, comments: note } = search.lookupFields({2    type: search.Type.CUSTOMER,3    id: 123,4    columns: ["email", "comments"]5});

lookup Customer(123) select email, lookup Customer(123)[email] and Customer(123)[email] are one operation. Destructuring works on any projection and lowers to JavaScript's own.

B

In the compiler, not yet published: npm 0.1.0 does not have it. Verified with mynt build on 13 Oct 2026.

  1. Reached the compiler.
C

SuiteScript methods this feature lowers to or works through. They are counted on their own pages, never through the feature.