def get_nested_field(fieldname, field_dict):
    """Takes a field name in dot notation and a dictionary of fields and finds the field in the dictionary"""
    fields = fieldname.split('.')
    nested_field = field_dict[fields[0]]
    for field in fields[1:]:
        nested_field = nested_field['fields'][field]
    return nested_field