You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 4
Next »
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
Parameter | Type | Default | Required | Description |
---|
field | str | ... | True | Path to field from which retrieve the value. Path with jmespath format (JMESPath documentation: https://github.com/jmespath/jmespath.py). |
field_highlight | Union[str, None] | None | False | Path 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). |
default | Union[Any, None] | None | False | Default value to use in case no value was found for the field. |
transform | Optional[List[Transformation]] | None | True | List 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_transformed | bool | - | True | Internal parameter. |
suffix | Union[str, None] | None | False | Suffix to append to the value or values. |
prefix | Union[str, None] | None | False | Prefix to append to the value or values. |
suffix_label | Union[str, None] | None | False | Suffix to append to the label of the field. |
prefix_label | Union[str, None] | None | False | Prefix to append to the label of the field. |
sort | Union[SortOrder, bool] | False | True | Sort order for values in an array. |
unique | bool | False | True | If the values are in an array, remove duplicates. |
show_blank | bool | False | True | If there is no value, or value is none, and show_blank is true, keep the field. |
replacement | Optional[str] | - | False | Replacement to replace matches in the transformations (used in TRANSFORM_REPLACE_FIRST, TRANSFORM_REPLACE_LAST, and TRANSFORM_REPLACE_ALL). |
pattern | Optional[str] | - | False | Pattern used to look for matches in the transformations (used in TRANSFORM_REPLACE_FIRST, TRANSFORM_REPLACE_LAST, and TRANSFORM_REPLACE_ALL). |
DynamicFieldUI
Parameter | Type | Default | Required | Description |
---|
type | DynamicFieldType | DynamicFieldType.TEXT | True | Type of the dynamic field. |
label | Union[str, None] | None | False | Label to show for this field. |
css_style | Union[__CSSStyle, None] | None | False | Style to apply in the HTML of the UI. |
css_class | Union[str, None] | None | False | Style to apply in the HTML component. |
translate | Union[str, None] | None | False | (TODO: Implement translation) |
translate_label | Union[str, None] | None | False | Translation label. |
analytics | Union[dict, None] | None | False | Analytics information. |
if_not_exist | Optional[str] | None | False | Show only if the specified field doesn't exist. |
if_exist | Optional[str] | None | False | Show only if the specified field does exist. |
only_on_highlight | bool | False | False | Show only when the value is highlighted. |
display | Optional[Any] | - | False | Value from the field to display. |
Name | Value |
---|
LOWER_CASE | lowerCase |
UPPER_CASE | upperCase |
CAMEL_CASE | camelCase |
KEBAB_CASE | kebabCase |
CAPITALIZE | capitalize |
LOWER_FIRST | lowerFirst |
UPPER_FIRST | upperFirst |
SNAKE_CASE | snakeCase |
REPLACE_FIRST | replaceFirst |
REPLACE_LAST | replaceLast |
REPLACE_ALL | replaceAll |
DynamicFieldType Enum
Name | Value |
---|
TEXT | text |
URL | url |
DATE | date |
DATE_AGE | date_age |
NUMBER | number |
SIZE | size |
MIME_TYPE | mime_type |
IMAGE | image |
THUMBNAILS | thumbnails |
BOOL | bool |
NESTED | nested |
KEY_VALUE | key_value |
TABLE | table |
TAGS | tags |
COLUMN_ACTION | column_action |
CHIP | chip |
CARROUSEL | carrousel |
CARROUSEL_VALUE | carrousel_value |
INNER_HITS | inner_hits |
_CSSStyle Model
Parameter | Type | Required | Description |
---|
label | Dict[str, str] | True | Dictionary for labels. |
display | Dict[str, str] | True | Dictionary for display. |
container | Dict[str, str] | True | Dictionary for containers. |
Dynamic Results Workflow
![](/download/attachments/822640700/fields.drawio.png?version=1&modificationDate=1693944777719&api=v2)