def get_selected_attrs(stream):
    """
    List down user selected fields
    requires [ "selected": true ] inside property metadata
    """

    list_attrs = list()
    for md in stream.metadata:
        if md["breadcrumb"]:
            if md["metadata"].get("selected", False) or md["metadata"].get("inclusion") == "automatic":
                list_attrs.append(md["breadcrumb"][-1])

    return list_attrs