For indicator cards, you can dynamically take over the indicator value and parts of the indicator type or evaluation type definition.

  • Result: The indicator value is displayed in the card. You can either display the numeric value, the semantic value, or the caption of the value range defined in the icon gallery definition of the indicator type.

    Card JSON code example:

    Microsoft adaptive cards display a complete empty card if a part of the card definition is not correct. Indicator values in Alfabet are returned as integer or float. The following example of an indicator value displayed in a column of a column set uses the Microsoft adaptive card variables $when and $if to cover all available types of indicator values. You can use a widget card template including this indicator value definition for all indicator types except for the indicator types having a range definition.

    • 'columns': [
      • {
        • 'type': 'Column',
        • 'width': 'auto',
        • 'items': [
          • {
            • 'type': 'RichTextBlock',
            • 'inlines': [
              • {
                • 'type': 'TextRun',
                • 'text': '${if(isString(indicatorvalue), indicatorvalue, formatNumber(indicatorvalue, 0))}',
                • 'wrap': true
              • }
            • ],
            • 'horizontalAlignment': 'Left',
            • '$when': '${isInteger(indicatorvalue)}'
          • },
          • {
            • 'type': 'RichTextBlock',
            • 'inlines': [
              • {
                • 'type': 'TextRun',
                • 'text': '${if(isString(indicatorvalue), indicatorvalue, formatNumber(indicatorvalue, 2))}',
                • 'color': '${indcolorvalue}',
                • 'weight':'${indvalweight}',
                • 'size': '${indvalsize}', 'wrap': true
              • }
          • ],
          • 'horizontalAlignment': 'Left',
          • '$when': '${isFloat(indicatorvalue)}'}
        • ],
        • 'height': 'stretch'
      • }
    • ]

    Attribute settings in the variable definition of the widget card template:

    • Mapping Type: TextOrValue.
    • Type: ClassProperty.
    • Class: Indicator.
    •  Class Property: Value to display the numeric value or SemanticValue to display the semantic value string, or <Threshold Caption> to display the caption defined for the value in the icon gallery definition of the indicator type.
    • Value: Leave this field empty.
  • Result: The icon assigned to the indicator value via the definition of an icon gallery for the indicator type is displayed in the card.

    Card JSON code example:

    • {
      • 'type': 'Image',
      • 'url': '${url}'
    • }

    Attribute settings in the variable definition of the widget card template:

    • Mapping Type: IconURL.
    • Type: ClassProperty.
    • Class: Indicator.
    • Class Property: Value.
    • Value: Leave this field empty.
  • Result: All card templates are configured to display the title defined in the Widget Title attribute of the widget definition in the indicator type editor as title of the card. If the title is not defined, the name of the indicator type will be displayed.

    Card JSON code example:

    • {
      • 'type': 'Container',
      • 'items': [
        • {
          • 'type': 'ColumnSet',
          • 'columns': [
            • { 'type': 'Column',
            • 'width': 'stretch',
            • 'items': [
              • { 'type': 'TextBlock',
              • 'text': '${indicatortypeName}',
              • }
              ]
            • }
          • ]
        • }
      • ],  
      • '$when': '${(empty(indicatortypeCaption))}'
    • }
    • {
      • 'type': 'Container',
      • 'items': [
        • {
          • 'type': 'ColumnSet',
          • 'columns': [
            • { 'type': 'Column',
            • 'width': 'stretch',
            • 'items': [
              • { 'type': 'TextBlock',
              • 'text': '${indicatortypeCaption}',
              • }
              ]
            • }
          • ]
        • }
      • ],  
      • '$when': '${!(empty(indicatortypeCaption))}'
    • }

    Attribute settings in the variable definition of the widget card template:

    You need to add the information about the widget title and the indicator type name to the card.

    Adding the indicator type name:

    The name is represented in the JSON of the standard widget templates by the indicatotypeName variable.

    • Mapping Type: TextOrValue.
    • Type: ClassProperty.
    • Class: IndicatorType.
    • Class Property: Name.
    • Value: Leave this field empty.

    Adding the widget card title:

    The widget card title is represented in the JSON of the standard widget templates by the indicatotypeCaption variable.

    • Mapping Type: TextOrValue.
    • Type: ClassProperty.
    • Class: IndicatorType.
    • Class Property: ACC_WidgetTitleOverride.
    • Value: Leave this field empty.
  • Result: All grouped card templates are configured to display the title defined in the Widget Title attribute of the widget definition in the evaluation type editor as title of the card. If the title is not defined, the name of the evaluation type will be displayed.

    Card JSON code example:

    • {
      • 'type': 'Container',
      • 'items': [
        • {
          • 'type': 'ColumnSet',
          • 'columns': [
            • { 'type': 'Column',
            • 'width': 'stretch',
            • 'items': [
              • { 'type': 'TextBlock',
              • 'text': '${CardTitle}',
              • }
              ]
            • }
          • ]
        • }
      • ],  
      • '$when': '${(empty(evaltypeCaption))}'
    • }
    • {
      • 'type': 'Container',
      • 'items': [
        • {
          • 'type': 'ColumnSet',
          • 'columns': [
            • { 'type': 'Column',
            • 'width': 'stretch',
            • 'items': [
              • { 'type': 'TextBlock',
              • 'text': '${evaltypeCaption}',
              • }
              ]
            • }
          • ]
        • }
      • ],  
      • '$when': '${!(empty(evaltypeCaption))}'
    • }

    Attribute settings in the variable definition of the widget card template:

    You need to add the information about the widget title and the evaluation type name to the card.

    Adding the evaluation type name:

    The name is represented in the JSON of the standard widget templates by the CardTitle variable.

    • Mapping Type: TextOrValue.
    • Type: ClassProperty.
    • Class: EvaluationType.
    • Class Property: Name.
    • Value: Leave this field empty.

    Adding the widget card title:

    The widget card title is represented in the JSON of the standard widget templates by the indicatotypeCaption variable.

    • Mapping Type: TextOrValue.
    • Type: ClassProperty.
    • Class: EvaluationType.
    • Class Property: ACC_Caption.
    • Value: Leave this field empty.
  • Result: All single indicator card templates are configured to display a description if a description is specified in the indicator type editor. Which of the descriptions is displayed depends on the setting of the Description to Display attribute of the widget definition in the indicator type editor. If the Description to Display attribute is set to Override Text, the description defined in the Override Text for Description attribute of the widget definition is displayed. If the Description to Display attribute is set to Default Text, the description provided for the indicator type in the Description attribute is displayed.

    Card JSON code example:

    • {
      • 'type': 'TextBlock',
      • 'text': '${inddesc}',
      • '$when': '${!(equals(showdesc,'Override Text'))}'
    • },
    • {
      • 'type': 'TextBlock',
      • 'text': '${inddescov}',
      • '$when': '${(equals(showdesc,'Override Text'))}'
    • }

    Attribute settings in the variable definition of the widget card template:

    You need to add the information about the override text in the widget definition, the setting of the Description to Display attribute, and the indicator type description.

    Adding the indicator type description:

    The description is represented in the JSON of the standard widget templates by the inddesc variable.

    • Mapping Type: TextOrValue.
    • Type: ClassProperty.
    • Class: IndicatorType.
    • Class Property: Description.
    • Value: Leave this field empty.

    Adding the override text in the widget definition:

    The widget override text for the description is represented in the JSON of the standard widget templates by the inddescov variable.

    • Mapping Type: TextOrValue.
    • Type: ClassProperty.
    • Class: IndicatorType.
    • Class Property: ACC_DescriptionOverride.
    • Value: Leave this field empty.

    Adding the information which of the descriptions to display:

    The setting which of the descriptions to display is represented in the JSON of the standard widget templates by the showdesc variable.

    • Mapping Type: TextOrValue.
    • Type: ClassProperty.
    • Class: IndicatorType.
    • Class Property: ACC_DescriptionOption.
    • Value: Leave this field empty.
  • Result: All horizontal grouped, multi-value card templates are configured to display a description if a description is specified in the evaluation type editor. Which of the descriptions is displayed depends on the setting of the Description to Display attribute of the widget definition in the evaluation type editor. If the Description to Display attribute is set to Override Text, the description defined in the Override Text for Description attribute of the widget definition is displayed. If the Description to Display attribute is set to Default Text, the description provided for the evaluation type in the Description attribute is displayed.

    Card JSON code example:

    • {
      • 'type': 'TextBlock',
      • 'text': '${inddesc}',
      • '$when': '${!(equals(showdesc,'Override Text'))}'
    • },
    • {
      • 'type': 'TextBlock',
      • 'text': '${inddescov}',
      • '$when': '${(equals(showdesc,'Override Text'))}'
    • }

    Attribute settings in the variable definition of the widget card template:

    You need to add the information about the override text in the widget definition, the setting of the Description to Display attribute, and the indicator type description.

    Adding the evaluation type description:

    The description is represented in the JSON of the standard widget templates by the inddesc variable.

    • Mapping Type: TextOrValue.
    • Type: ClassProperty.
    • Class: EvaluationType.
    • Class Property: Description.
    • Value: Leave this field empty.

    Adding the override text in the widget definition:

    The widget override text for the description is represented in the JSON of the standard widget templates by the inddescov variable.

    • Mapping Type: TextOrValue.
    • Type: ClassProperty.
    • Class: EvaluationType.
    • Class Property: ACC_DescriptionOverride.
    • Value: Leave this field empty.

    Adding the information which of the descriptions to display:

    The setting which of the descriptions to display is represented in the JSON of the standard widget templates by the showdesc variable.

    • Mapping Type: TextOrValue.
    • Type: ClassProperty.
    • Class: EvaluationType.
    • Class Property: ACC_DescriptionOption.
    • Value: Leave this field empty.
  • Result: The measurement unit defined by the user in the card settings in the Unit field is displayed in the card.

    Card JSON code example:

    • {
      • 'type': 'TextRun',
      • 'text': '${unitvalue}',
    • }

    Attribute settings in the variable definition of the widget card template:

    • Mapping Type: TextOrValue.
    • Type: ClassProperty.
    • Class: IndicatorType.
    • Class Property: MeasurementUnit.
    • Value: Leave this field empty.
  • Result: The measurement unit defined by the user in the card settings in the Unit field is displayed in the card.

    Card JSON code example:

    • {
      • 'type': 'TextRun',
      • 'text': '${indvalue}',
      • 'color': '${indcolorvalue}'
    • }

    Attribute settings in the variable definition of the widget card template:

    • Mapping Type: Color.
    • Type: ClassProperty.
    • Class: Indicator.
    • Class Property: Value.
    • Value: Leave this field empty.