Acumatica Business Central Sage Intacct STACK Takeoff & Estimate Velixo Classic Velixo CLI
Acumatica Business Central Sage Intacct STACK Takeoff & Estimate Velixo Classic Velixo CLI

GI

Velixo recommends Microsoft 365 or Excel 2021 or higher for this feature. Experimentally, Excel 2010 or higher can be used. For prerequisites and an overview of Generic Inquiries, see Introduction to Generic Inquiries.

Overview

The GI function returns the contents of the specified generic inquiry (GI).

Syntax

This is the syntax for this function:

=GI(
    ConnectionName,
    Name,
    Filter,
    Select,
    IncludeHeader,
    OutputColumn1, 
    ...
)

Arguments

Argument

Required/Optional

Description

ConnectionName

Optional

Provide one of the following values:

OR

Omit the argument to return results for all compatible connections with default aggregation settings.

Name

Required

The name of the generic inquiry.

To search for generic inquiry names, use the Inquiry Title lookup on the Generic Inquiry page in Acumatica.

Use only letters, numbers, spaces, hyphens (-), and underscores (_) in the inquiry name. Velixo can't find a generic inquiry whose name contains certain special characters, such as &, %, /, ., #, or +. For details, see Error: Generic inquiry not found when the inquiry name contains special characters.

Filter

Optional

The conditions that determine which records should be selected from the inquiry.

The recommended way to construct this argument is by using the GIFILTER. Otherwise, see the OData filter reference sheet.

Select

Optional

Comma-separated list of field names to be included in the resulting dataset. If this argument is empty, all the columns from the generic inquiry will be returned (including columns that may not be shown in the ERP's user interface; see the Known Issues section).

Rows where the selected columns have no value are included in the results - see Rows with no value in selected columns.

IncludeHeader

Optional

TRUE or FALSE, indicating if column headers should be included in the dataset.

Default value: TRUE

To query a generic inquiry that has parameters, provide a two-column range in the Name argument instead of the inquiry name. See Generic inquiries with parameters below.

Velixo NX-only arguments :

Argument

Required/ Optional

Description

OutputColumn1

Optional

If no other Output Column is specified, this argument contains the cell location where the data is to be placed - as an Excel table.

If more than one Output Column is specified, this argument specifies the cell in which the first column of the array is to appear within the table.

OutputColumn2

Optional

If more than one Output Column is specified, this argument specifies the cell in which the second column of the array is to appear within the table.

...



OutputColumnN

Optional

Ifmore than one Output Column is specified, this argument specifies the cell in which the last column of the array is to appear within the table.

Excel Online

Loading large datasets with the GI() function is not performant in Excel Online due to the limitations of the Excel platform in the browser. If your dataset contains more than approximately 100,000 records, we strongly recommend using a desktop version of Excel 365 for Windows or Mac OS.

Rows with no value in selected columns

The function returns all rows from the generic inquiry, including rows where the selected columns have no value. Blank cells in the results are expected and are not an error.

Because every returned record produces a row, the spilled range sizes to the number of records in the inquiry result, not to the number of populated values. For example, selecting a column that is populated for 5 of 493 records returns 493 rows containing 5 populated cells.

To exclude rows with no value in a column, build the filter with GIFILTER using <>null as the criteria and pass the result into the Filter argument:

=GIFILTER(
    "Acumatica",
    "AR-Customers",
    "ParentAccount",
    "<>null"
)

This returns the OData clause ParentAccount ne null. See Filter blank or non-blank values in Filtering Generic Inquiries for details.

Examples

Creating an array

=GI(
    "Demo",
    "VelixoReportsPro-Projects",
    A1,
    "ProjectCD, Description",
    FALSE
)


Description: Returns the project code and the description of records returned by the VelixoReportsPro-Projects generic inquiry, which match the filter conditions specified in cell A1. FALSE as the last argument specifies that no column headers should be returned. This information is displayed as an Excel array.

Result:

Excel worksheet showing GI function result as a spilled array with ProjectCD and Description columns from VelixoReportsPro-Projects inquiry

Creating an Excel table

You can find the following and other examples of creating Excel tables in the article about Table Mirroring.

Certain Excel features do not work with Excel arrays but, rather, require that data be in an Excel table.

As a result, it can be convenient to have the option to create such a table from our generic inquiry data.

This example...

=GI(
    "Demo",
    "AR-Invoices and Memos",
    "Type eq 'Credit Memo'",
    "Type, ReferenceNbr, Status, Customer, PostPeriod, Amount",
    FALSE
)


...would return data from the AR-Invoice and Memos generic inquiry and display it as an Excel array:

Excel worksheet showing GI function returning AR Invoice and Memo data as a spilled array with Type, ReferenceNbr, Status, Customer, PostPeriod, and Amount columns


If, however, we modify the function by adding a value for the (Velixo NX only) OutputColumn1 argument...

=GI(
    "Demo",
    "AR-Invoices and Memos",
    "Type eq 'Credit Memo'",
    "Type,ReferenceNbr,Status,Customer,PostPeriod,Amount",
    FALSE,
    H2
)


Description: This returns the data from the generic inquiry and displays it as an Excel table starting in cell H2.

Result:

Excel worksheet showing the same GI function result displayed as a formatted Excel table starting at cell H2 using the OutputColumn1 argument


The GI() function still resides in cell A2, and the same data is returned. However, the results are displayed as an Excel table starting in the cell specified in the OutputColumn1 argument.

Configuration

For configuration details, see Generic Inquiries Options.

Generic inquiries with parameters

A generic inquiry in Acumatica can have parameters: values you enter on the inquiry page to narrow its results, such as a warehouse or a vendor. To pass parameter values from Excel, provide a two-column range in the Name argument of GI, GILOOKUP, or GILOOKUPF instead of the inquiry name.

Parameters require Acumatica 2024R2 or later.

You define the parameters of an inquiry on the Parameters tab of the Generic Inquiry page in Acumatica, for example:

Acumatica Generic Inquiry configuration showing pre-defined filter parameters that restrict results but are not supported via OData

Building the Name range

Each row of the range holds a key in the first column and its value in the second column. For example, to query the DB-StorageDetails inquiry for one warehouse, enter:


A

B

1

giName

DB-StorageDetails

2

Warehouse

VA-WHOLESL

The range follows these rules:

  • The giName row is required. Its value is the inquiry name, the same value you would otherwise enter in Name. The same restrictions on special characters in the inquiry name apply.

  • Every other key is the name of an inquiry parameter, as shown in the Name column on the Parameters tab of the Generic Inquiry page in Acumatica, not the Display Name. If you use a name the inquiry doesn't have, the error message lists the parameter names it does have.

  • Keys are not case-sensitive, and spaces before and after a key are ignored. A parameter name can't contain spaces or punctuation characters other than the underscore (_).

  • Each key can appear only once.

  • The rows can be in any order. Rows with an empty first column are ignored.

  • Don't add a header row such as Key and Value. Velixo reads every row as a key and its value.

  • The range must have exactly two columns.

  • Instead of a worksheet range, you can use an array constant, such as {"giName","DB-StorageDetails";"Warehouse","VA-WHOLESL"}, or the output of VX.SETTINGS. VX.SETTINGS merges repeated keys, so the duplicate-key error doesn't appear.

  • A range with only the giName row works the same as entering the inquiry name.

Required and optional parameters

A parameter is required when Is Required is selected for it on the Parameters tab in Acumatica.

  • If you don't provide a value for a required parameter, the function returns an error that names the parameter.

  • If you enter only the inquiry name, or a range with only the giName row, for an inquiry that has required parameters, the function returns an error that lists them.

  • You can leave out an optional parameter or leave its value empty. Velixo then doesn't send a value for it. Whether the inquiry returns rows depends on how its conditions in Acumatica handle an empty parameter.

Parameter values

Velixo converts each value to the data type that the inquiry declares for the parameter.

Parameter type

Accepted values

Text

Any value. Velixo sends numbers and dates as text.

Number

An Excel number, or text that contains a number.

True/false

TRUE, FALSE, 1, or 0. Text such as true or false is also accepted.

Date or date and time

An Excel date. Text dates are also accepted in these formats: YYYY-MM-DD, YYYY-MM-DD HH:MM:SS, MM/DD/YYYY, MM/DD/YYYY HH:MM:SS, MM/DD/YYYY HH:MM:SS AM/PM, MM/DD/YY, and DD MMM YYYY.

GUID

A GUID in the xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx format, without braces.

If a value can't be converted to the parameter's type, the function returns an error before it contacts Acumatica. Acumatica then checks the value. If Acumatica validates the parameter, for example, a project ID, a value that doesn't exist returns an error. Otherwise, the function returns Function returned zero rows (#N/A).

Combining parameters with a filter

You can use parameters and the Filter argument together. Acumatica applies both. GIFILTER takes the inquiry name as text. If you pass the two-column range to GIFILTER instead, Excel returns #CALC!.

=GI(
    "Demo",
    A1:B2,
    GIFILTER("Demo", "DB-StorageDetails", "InventoryID", "WIDGET*"),
    "InventoryID,InventoryDescription,QtyOnHand"
)

Description: Returns the widget items (inventory IDs starting with WIDGET) in the VA-WHOLESL warehouse, with their description and quantity on hand. Cells A1:B2 contain the range shown above.

Result:

image-20261110-124140.png

If a formula returns an error, see Errors when passing parameters to a generic inquiry.

Filtering large generic inquiry datasets

If you experience either long load times or a persistent #BUSY! message for inquiries with a very large result set (e.g., GL transactions or invoices), make sure to always supply a GIFILTER filter when using the other GI-related functions with such inquiries.

In Velixo Classic, if you're using always load the entire Generic Inquiry to enable more advanced OData syntax, consider disabling it for larger inquiries and rewriting your filters so that they do not involve ODATA functions unsupported by Acumatica [such as toupper()]. Applying your filters on the server [before downloading the data] can significantly reduce the load time.

Known issues

The GI() function may return more columns than you expect.

For example, a generic inquiry that queries PMProject returns the ProjectID field, which is not specified on the result grid.

It is a correct behavior, as Acumatica unconditionally adds to the GI result all key columns of the objects used in the GI.

If you don't like seeing them, please use the Select argument to explicitly specify the columns you'd like to see in the result.