def add_append_list_filter(source, args, index):
    """Add the hxlappend filter to the end of the chain with an external list."""
    exclude_columns = args.get('append-list-exclude-columns%02d' % index, False
        )
    source_list_url = args.get('append-list-url%02d' % index, None)
    row_query = args.get('append-list-where%02d' % index, None)
    return source.append_external_list(source_list_url=source_list_url,
        add_columns=not exclude_columns, queries=row_query)
