Skip to main content

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

NameTypeDescription
parametersdictA dictionary containing configuration or request parameters to search within.
keystringThe specific key used to look up the target value in the parameters dictionary.

Returns

TypeDescription
AnyThe last item of the list if the value is a list, or the original value if it is a scalar.