def get_text_unit_field(sample, biosample_name, field_to_fetch, is_list=False):
    """
    This function will parse text and unit fields in biosamples
    :param sample: sample to parse
    :param biosample_name: name to use in biosample record
    :param field_to_fetch: text or unit to use
    :param is_list: does this record allow to use multiple values
    :return: parsed biosample record
    """
    if is_list:
        tmp = list()
        if biosample_name in sample['characteristics']:
            for item in sample['characteristics'][biosample_name]:
                tmp.append(item[field_to_fetch])
        return tmp
    else:
        if biosample_name in sample['characteristics']:
            return sample['characteristics'][biosample_name][0][field_to_fetch]
        else:
            return ''