get_last_value_from_parameters
Retrieves the specified key from the parameters dictionary, returning the last element if the value is a list or the value itself otherwise.
def get_last_value_from_parameters(
parameters: dict,
key: string
) - > Any
Retrieves the final element from a parameter value if it is a list, otherwise returns the value directly.
Parameters
| Name | Type | Description |
|---|---|---|
| parameters | dict | A dictionary containing configuration or request parameters to search within. |
| key | string | The specific key used to look up the target value in the parameters dictionary. |
Returns
| Type | Description |
|---|---|
Any | The last item of the list if the value is a list, or the original value if it is a scalar. |