> For the complete documentation index, see [llms.txt](https://kb.logicerp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.logicerp.com/logic-erp-version-release-notes/november-2026/writing-formulas-in-the-script-editor/script-editor.md).

# Script Editor

Logic ERP has improved the **Script Editor** for reports with **variable columns** - a group of columns that the report adds by itself, such as one column for each allowance and deduction in the **Payroll Summary Report**. A **VB.NET** formula can now go through all the columns of such a group, and **Convert to VB.NET** now converts PowerShell and VBScript formulas that do this.

***

### **What's new**

* **Variable column groups in VB.NET formulas** - a group shows in the **Field List** under its own name. In the formula it is written **Arr\_** followed by the group name, with spaces and symbols written as **\_** - for example the group **ALLOW/DED** is written **Arr\_ALLOW\_DED**. Each column of the group has a **Name** (the column's caption) and a **Value**.
* **Convert to VB.NET for PowerShell** - a PowerShell formula that goes through a group with **ForEach** is now converted. Earlier this part was left out of the conversion.
* **Convert to VB.NET for VBScript** - a column's **Value** is now read as a number, the same way PowerShell read it. A blank value counts as **0**.
* **A group used as one value** - when a VBScript formula uses a whole group where one value is expected, the conversion now lists it as a problem and leaves that line for you to correct, instead of converting it wrongly.

> **Example — Actual salary from net salary**
>
> The **ACTUAL SALARY** column adds the **LOAN DEDUCT** and **TDS** columns back to **ORG NET SALARY** and takes away **BONUS** and **INCENTIVE**. For an employee with ORG NET SALARY ₹18,234.67, LOAN DEDUCT ₹1,500.50, BONUS ₹3,000 and INCENTIVE ₹0.25, the formula below gives ₹16,734.92 - the same as the old PowerShell formula.

```vb
'#@VBNET
Dim TempLoanDeduct As Double = 0
Dim TempTDS As Double = 0
Dim TempBonus As Double = 0
Dim TempIncentive As Double = 0
Dim TmpVarCol As Object

For Each TmpVarCol In Arr_ALLOW_DED
    Dim ColValue As Double = Val(TmpVarCol.Value & "")
    If ColValue > 0 Then
        Select Case UCase(TmpVarCol.Name & "")
            Case "LOAN DEDUCT" : TempLoanDeduct = ColValue
            Case "TDS" : TempTDS = ColValue
            Case "BONUS" : TempBonus = ColValue
            Case "INCENTIVE" : TempIncentive = ColValue
        End Select
    End If
Next
ACTUAL_SALARY = Round(ORG_NET_SALARY + TempLoanDeduct + TempTDS - TempBonus - TempIncentive, 2)
```

***

### **Check after converting**

* In PowerShell, a check such as **-gt 0** on a column's value compared it as text, so a **negative** value also passed. After conversion the check compares numbers, so negative values are left out. If a group can hold negative values, check the results of the converted formula, and change **> 0** to **<> 0** if they should be counted.

***

For more detailed information, [Click Here](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/writing-formulas-in-the-script-editor/script-editor.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://kb.logicerp.com/logic-erp-version-release-notes/november-2026/writing-formulas-in-the-script-editor/script-editor.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
