API Stability Long-Term

The getFileContent() GraphQL query is used to get contents of a CSV file.

See the newFile() for information creating a new file, and updateFile() for updating data in an already uploaded or created file. You might also want to see the Lookup Files documentation page, if that's related to your reason for uploading a file.

Syntax

Below is the syntax for the getFileContent() query field:

graphql
getFileContent(
     name: string!
     fileName: string!
     filterString: string
     offset: integer
     limit: integer
   ): UploadedFileSnapshot!

For the input, there are several parameters, with the the basic datatypes of strings and integers. They're described in the Given Datatypes section below. What to use for the return, for UploadedFileSnapshot is listed in the Results Datatypes section. Below is an example with fictitious data.

Show:
graphql
query {
  getFileContent(
    fileName: "test.csv", 
    name: "humio", 
    filterString: "Barbara"
  )
  { nameAndPath{name, path}, 
    totalLinesCount,
    headers, lines
  }
}
Example Responses
Show:
json
{
  "data": {
    "getFileContent": {
      "nameAndPath": {
        "name": "test.csv",
        "path": null
      },
      "totalLinesCount": 1,
      "headers": [
        "id",
        "first",
        "last"
      ],
      "lines": [
        [
          "6",
          "Barbara",
          "Mills"
        ]
      ]
    }
  }
}

This example is gets the file from the repository, and returns rows containing the search text given for filterString. It also returns the name and path of the file, and the number of rows found — which is only one here. And it returns the data found matching the search text.

Given Datatypes

The given datatypes are described in the table below:

Table: Mix of Input for getFileContent

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Sep 10, 2024
namestringyes  The name of the repository associated with the file.
fileNamestringyes  The name of the uploaded or created file.
filterStringstring   Case-insensitive text on which to search the row.
limitinteger 50 The maximum number of rows to return from the file.
offsetinteger 0 The initial number of rows to skip; display only rows after number given.

Returned Datatypes

The returned datatype UploadedFileSnapshot has its own parameters. Below is a list of them along with their datatypes and a description of each:

Table: UploadedFileSnapshot

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Mar 27, 2025
filterStringstring  Long-TermAny string on which to filter the data.
headers[string]yes Long-TermThe headers for the uploaded snapshot file.
limitintegeryes Long-TermThe file upload limit.
lines[string]yes Long-TermThe contents of the file in the form of a list of lines, with each line being itself a list of column values. When the file is empty or nothing matches filterString, then [] is returned.
nameAndPathFileNameAndPathyes Long-TermThe name and path of the uploaded snapshot file. See FileNameAndPath.
offsetintegeryes Long-TermThis is the offset supplied to a file query. For a new or updated file, this is always 0.
resourcestring  Short-TermThe resource identifier for the file.
totalLinesCountlongyes Long-TermThe total number of lines in the uploaded snapshot file.