#accept input data and keys "Status" and "Call" async def nested_get(input_dict, nested_key): internal_dict_value = input_dict for k in nested_key: internal_dict_value = internal_dict_value.get(k, None) if internal_dict_value is None: return None #test to ensure Status is part of the new list test = any("Status" in d for d in internal_dict_value) #if true return the final list value if test == True : final_list = [i["Status"] for i in internal_dict_value] return final_list else : return None