Versions Compared

Key

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

The Dynamic Fields Framework is meant to be used with the Dynamic Results Stage. This framework is meant for UI only hence it requires that the UI project knows how to interpret properly the Dynamic Fields sent in the response.

DynamicField

ParameterTypeDefaultRequiredDescription
fieldstr...TruePath to field from which retrieve the value. Path with jmespath format (JMESPath documentation: https://github.com/jmespath/jmespath.py).
field_highlightUnion[str, None]NoneFalsePath to highlight field from which retrieve the value, in case it is not the same as the field parameter. Path with jmespath format (JMESPath documentation: https://github.com/jmespath/jmespath.py).
defaultUnion[Any, None]NoneFalseDefault value to use in case no value was found for the field.
transformOptional[List[Transformation]]NoneTrueList of transformations to be applied to the displayed values. The order in which the transformations are specified is the order in which the transformations will be applied.
_label_transformedbool-TrueInternal parameter.
suffixUnion[str, None]NoneFalseSuffix to append to the value or values.
prefixUnion[str, None]NoneFalsePrefix to append to the value or values.
suffix_labelUnion[str, None]NoneFalseSuffix to append to the label of the field.
prefix_labelUnion[str, None]NoneFalsePrefix to append to the label of the field.
sortUnion[SortOrder, bool]FalseTrueSort order for values in an array.
uniqueboolFalseTrueIf the values are in an array, remove duplicates.
show_blankboolFalseTrueIf there is no value, or value is none, and show_blank is true, keep the field.
replacementOptional[str]-FalseReplacement to replace matches in the transformations (used in TRANSFORM_REPLACE_FIRST, TRANSFORM_REPLACE_LAST, and TRANSFORM_REPLACE_ALL).
patternOptional[str]-FalsePattern used to look for matches in the transformations (used in TRANSFORM_REPLACE_FIRST, TRANSFORM_REPLACE_LAST, and TRANSFORM_REPLACE_ALL).

DynamicFieldUI

ParameterTypeDefaultRequiredDescription
typeDynamicFieldTypeDynamicFieldType.TEXTTrueType of the dynamic field.
labelUnion[str, None]NoneFalseLabel to show for this field.
css_styleUnion[__CSSStyle, None]NoneFalseStyle to apply in the HTML of the UI.
css_classUnion[str, None]NoneFalseStyle to apply in the HTML component.
translateUnion[str, None]NoneFalse(TODO: Implement translation)
translate_labelUnion[str, None]NoneFalseTranslation label.
analyticsUnion[dict, None]NoneFalseAnalytics information.
if_not_existOptional[str]NoneFalseShow only if the specified field doesn't exist.
if_existOptional[str]NoneFalseShow only if the specified field does exist.
only_on_highlightboolFalseFalseShow only when the value is highlighted.
displayOptional[Any]-FalseValue from the field to display.

Transformation Enum

NameValue
LOWER_CASElowerCase
UPPER_CASEupperCase
CAMEL_CASEcamelCase
KEBAB_CASEkebabCase
CAPITALIZEcapitalize
LOWER_FIRSTlowerFirst
UPPER_FIRSTupperFirst
SNAKE_CASEsnakeCase
REPLACE_FIRSTreplaceFirst
REPLACE_LASTreplaceLast
REPLACE_ALLreplaceAll

DynamicFieldType Enum

NameValue
TEXTtext
URLurl
DATEdate
DATE_AGEdate_age
NUMBERnumber
SIZEsize
MIME_TYPEmime_type
IMAGEimage
THUMBNAILSthumbnails
BOOLbool
NESTEDnested
KEY_VALUEkey_value
TABLEtable
TAGStags
COLUMN_ACTIONcolumn_action
CHIPchip
CARROUSELcarrousel
CARROUSEL_VALUEcarrousel_value
INNER_HITSinner_hits

_CSSStyle Model

ParameterTypeRequiredDescription
labelDict[str, str]TrueDictionary for labels.
displayDict[str, str]TrueDictionary for display.
containerDict[str, str]TrueDictionary for containers.

Dynamic Results Workflow

Image Added