def form_diff_table_comparison_value(val):
    """
    Function for converting the given value to a suitable UI value for presentation in the diff table
    on the admin forms for update requests.

    :param val: the raw value to be converted to a display value
    :return:
    """
    if val is None:
        return ""
    if isinstance(val, list) and len(val) == 0:
        return ""

    if isinstance(val, list):
        dvals = []
        for v in val:
            dvals.append(form_diff_table_comparison_value(v))
        return ", ".join(dvals)
    else:
        if val is True or (isinstance(val, str) and val.lower() == "true"):
            return "Yes"
        elif val is False or (isinstance(val, str) and val.lower() == "false"):
            return "No"
        return val