def format_value(val):
    """
    A helper function to format fields for table output.
    Converts nested dicts into multilist strings.
    """
    if isinstance(val, dict):
        return "\n".join([ f"{k}: {val[k]}" for k in val.keys()])
    return val