Using Parameterlists in Scripts

There are different ways to read records of your parameterlists in your scripts.

GetParameterListItems

This script-method returns a list of all records of a specific parameterlist. Use the result to iterate through all of the records and read values out of specific cells.

The method needs the code of the parameterlist that you intend to read as the only argument.

// Read all parameters from the parameterlist with the code "LIST1".
var parameterList = GetParameterListItems("LIST1");

// Iterate through all records
foreach(var parameter in parameterList)
{
  // Read the cell "Schema" and assign it to a parameter that will e used 
  // in a probe query later on.
  var schema = parameter["Schema"];
  SetParameter("Schema", schema);

  // Read the cell "Table" and assign it to a parameter that will e used 
  // in a probe query later on.
  var table = parameter["Table"];
  SetParameter("Table", table);

  // Test ausführen
  await ExecuteAsync();
}

FilterParameterListById

This method filters a specific parameterlist by the ID of a record. Using this filter, the GetParameterListItems-method (documented above) returns only the record with the filtered ID.

The method takes two arguments. The first one is the code of the parameterlist you intend to filter. The second one is the numeric ID of the record that should be filtered.

FilterParameterListById("LIST1", 18);

// Read the parameterlist with the code "LIST1".
// Because of the previously applied filter, the method returns only
// one record with the ID 18.
var parameterList = GetParameterListItems("LIST1");

FilterParameterListByIds

This method filters a specific parameterlist by a list of ID’s of records. Using this filter, the GetParameterListItems-method (documented above) returns only the records with the filtered ID’s.

The method takes two arguments. The first one is the code of the parameterlist you intend to filter. The second one is an array of numeric ID’s of the records that should be filtered.

FilterParameterListByIds("LIST1", new long[] { 18, 19 });

// Read the parameterlist with the code "LIST1".
// Because of the previously applied filter, the method returns only
// the records with the ID's 18 and 19.
var parameterList = GetParameterListItems("LIST1");

FilterParameterListByFieldValue

Applies a filter to a specific parameterlist to filter it by a column-value. Using this filter, the GetParameterListItems-method (documented above) returns only the records with the specific column-value.

The method takes three arguments. The first one is the code of the parameterlist you intend to filter. The second one is the name of the column that should be filtered. And the third one is the value of the column used in the filter.

FilterParameterListByFieldValue("LIST1", "Schema", "Sales");

// Read the parameterlist with the code "LIST1".
// Because of the previously applied filter, the method returns only
// the records that have the value "Sales" in the "Schema"-column.
var parameterList = GetParameterListItems("LIST1");

Applies a filter to a specific parameterlist to filter it by multiple column-values. Using this filter, the GetParameterListItems-method (documented above) returns only the records with the specific column-values.

The method takes three arguments. The first one is the code of the parameterlist you intend to filter. The second one is the name of the column that should be filtered. And the third one is an array that contains the values of the column used in the filter.

FilterParameterListByFieldValues("LIST1", "Schema", new object[] { "Sales", "HR" });

// Read the parameterlist with the code "LIST1".
// Because of the previously applied filter, the method returns only
// the records that have the value "Sales" and "HR" in the "Schema"-column.
var parameterList = GetParameterListItems("LIST1");

Table of Contents