GetType
Returns the condition value type for the icon criterion.
Syntax
expression.GetType();
expression - A variable that represents a ApiIconCriterion class.
Parameters
This method doesn't have any parameters.
Returns
XlConditionValueTypes | null
Example
Read the value type of an icon criterion in a spreadsheet.
// How do I find out whether an icon criterion uses a number, percent, or formula as its threshold in a spreadsheet?
// Inspect what kind of threshold an icon criterion is set to compare against in a spreadsheet.
let worksheet = Api.GetActiveSheet();
worksheet.GetRange("A1").SetValue("Scores");
worksheet.GetRange("A2").SetValue(85);
worksheet.GetRange("A3").SetValue(70);
worksheet.GetRange("A4").SetValue(55);
let range = worksheet.GetRange("A2:A4");
let formatConditions = range.GetFormatConditions();
let iconCondition = formatConditions.AddIconSetCondition();
let criteria = iconCondition.GetIconCriteria();
let firstCriterion = criteria[0];
let criterionType = firstCriterion.GetType();
worksheet.GetRange("B1").SetValue("First criterion type: " + criterionType);