Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Scripting_function


Panel
titleDescription

Takes in a dataset and returns the headers as a Python list.

Client permissions restrictions


Panel
titleSyntax

system.dataset.getColumnHeaders(dataset)

  • Parameters

Dataset dataset - The input dataset.

  • Returns

List - A list of column header strings.

  • Scope

Gateway, Vision Client, Perspective Session

Panel
titleCode Examples
Code Block
languagepy
titleCode Snippet
# This example fetches the dataset from a Vision table, and prints the table headers as a list.
# Fetch data from table component.
data = event.source.parent.getComponent('Table').data
# Print dataset headers.
print system.dataset.getColumnHeaders(data)
Code Block
languagepy
titleCode Snippet
# Fetch data from Power Table component.
data = event.source.parent.getComponent('Power Table').data

# Print dataset headers.
print system.dataset.getColumnHeaders(data)

# Convert list to a string
listAsString = ' '.join(system.dataset.getColumnHeaders(data))

# Print list as string
print listAsString

# Do something useful, such as write the string to a label component
event.source.parent.getComponent('Label').text = listAsString
Panel
titleKeywords

system dataset getColumnHeaders, dataset.getColumnHeaders