def gather_flex_fields(row, flex_data):
    """ Getting the flex data, formatted for the error and warning report, for a row.

        Args:
            row: the dataframe row to get the flex data for
            flex_data: the dataframe containing flex fields for the file

        Returns:
            The concatenated flex data for the row if there is any, an empty string otherwise.
    """
    if flex_data is not None:
        return flex_data.loc[flex_data['row_number'] == row['Row Number'], 'concatted'].values[0]
    return ''