Skip to content

Use the Lowgile Console

This tutorial describes how to use the Lowgile console during development to build and execute custom code, test expressions, inspect runtime data, and troubleshoot application behavior.

Before beginning this tutorial, you should:

  • Have access to the Lowgile platform development environment, and
  • Be familiar with basic TypeScript or JavaScript syntax.

Tip

For a quick reference, see TypeScript Patterns in Lowgile.

The following sections describe common development workflows.

The Lowgile console is available from the main Lowgile platform editor. It is not available from a running application or from individual object type editors.

Open the console by clicking the console icon in the top-right nav bar, or press F8.

Before executing application-specific code, select the correct application module context (e.g., Orders or Purchasing).

After setting the module context, use This as an alias for the selected module.

For example, when the Orders module is selected:

const materials = This.Materials.getEntryList()

instead of using:

const materials = Orders.Materials.getEntryList()

Tip

For more information about using This as a module alias, see Using This in Lowgile.

The module context selector also includes a wildcard option: *.

When this option is selected, reference application objects using their full module name instead of This.

For example, the following code will not execute when the wildcard option is selected:

const materials = This.Materials.getEntryList()

Use the full module name instead:

const materials = Orders.Materials.getEntryList()

Tip

Using the wildcard module context allows you to execute code for different application modules without updating the module context.

As well as the module selector, the console nav bar also includes the following controls:

  • Execute: Executes the current script or code block.
  • Execute selection: Only executes the highlighted section of code.
  • Clear output: Clears the console output window.

For example, to execute the following code block in full, click Execute:

const materials = This.Materials.getEntryList().map(e => ({ ...e, id: undefined }))
return materials

To execute only part of a script, select the required code and click Execute selection.

For example, in the following code snippet, select the final line (return This.Materials.getEntryList()) and click Execute selection:

const materials = This.Materials.getEntryList().map(e => ({ ...e, id: undefined }))
return materials
return This.Materials.getEntryList()

Attention

The following points bear relevance to the console controls:

  1. Clicking Execute runs the script from beginning to end, or until it reaches the first return statement. Any code after the first return will not execute.
  2. If no code is highlighted, clicking Execute selection does not execute the script and the console returns null.

The following examples demonstrate common development and debugging tasks performed in the Lowgile console.

Use the console to prototype custom logic before adding it to workflows, services, scripts, or AI-assisted extraction workflows.

For example, the following code calcluates VAT and returns both the intermediate and final values:

const subtotal = 1250
const vat = subtotal * 0.15
return {
subtotal,
vat,
total: subtotal + vat
}

The returned object allows you to verify that the calculation produces the expected values before reusing the logic elsewhere in the application.

Tip

For more information about building AI-powered applications, see Working with AI in Lowgile.

The console can be used to execute simple runtime expressions.

For example:

return 1 + 1

Static entities can be inspected directly in the console.

For example:

return Orders.Materials.getEntryList()

This returns all entries currently loaded by the Materials static entity.

Use TypeScript expressions to transform returned data before it is displayed in the console.

For example, in the following code snippet:

  • The map() function creates a new object for each entry.
  • The spread operator copies the existing properties, while id: undefined removes the id value from the returned output.
const materials = Orders.Materials.getEntryList().map(e => ({ ...e, id: undefined }))
return materials

The console then displays the transformed data:

JSON
[
{
"name": "UP GM 203",
"alternativeNames": "GPO-3, HM2471"
},
{
"name": "PF CP 201",
"alternativeNames": "HP2061"
}
]

Use the console to verify that static entity entries have been loaded correctly from an external source, such as a spreadsheet. For example, to retrieve the entries loaded into the Materials static entity, execute:

return This.Materials.getEntryList()

If the spreadsheet was loaded successfully, the console returns the static entity entries:

For example:

JSON
[
{
"id": 1,
"name": "UP GM 203",
"alternativeNames": "GPO-3, HM2471"
},
{
"id": 2,
"name": "PF CP 201",
"alternativeNames": "HP2061"
},
{
"id": 3,
"name": "PF CC 201",
"alternativeNames": "HGW2082"
}
]

If the configuration is incorrect or the data has not loaded successfully, the console may return an empty list, incomplete values, or a runtime error.