def get_form_responses(begin_datetime, end_datetime):
    'Get all form responses using Kobo api.'
    (auth, form_fields) = get_kobo_params()
    (form_responses, form_labels) = get_responses_from_kobo(auth, form_fields.get('name'))
    forms = [parse_form_response(f, form_fields, form_labels) for f in form_responses]
    filtered_forms = []
    for form in forms:
        date_value = form.get('date')
        conditions = [(form.get(k) == v) for (k, v) in form_fields.get('filters').items()]
        conditions.append((begin_datetime <= date_value))
        conditions.append((date_value < end_datetime))
        if (all(conditions) is False):
            continue
        filtered_forms.append(form)
    sorted_forms = sorted(filtered_forms, key=(lambda x: x.get('date')))
    sorted_forms = [{**f, 'date': f.get('date').date().isoformat()} for f in sorted_forms]
    return sorted_forms
Get all form responses using Kobo api.
def get_form_responses(begin_datetime, end_datetime):
    
    (auth, form_fields) = get_kobo_params()
    (form_responses, form_labels) = get_responses_from_kobo(auth, form_fields.get('name'))
    forms = [parse_form_response(f, form_fields, form_labels) for f in form_responses]
    filtered_forms = []
    for form in forms:
        date_value = form.get('date')
        conditions = [(form.get(k) == v) for (k, v) in form_fields.get('filters').items()]
        conditions.append((begin_datetime <= date_value))
        conditions.append((date_value < end_datetime))
        if (all(conditions) is False):
            continue
        filtered_forms.append(form)
    sorted_forms = sorted(filtered_forms, key=(lambda x: x.get('date')))
    sorted_forms = [{**f, 'date': f.get('date').date().isoformat()} for f in sorted_forms]
    return sorted_forms