def fill_fields_template(fields, templates):
    """
        Substitute the name, type and value for all the fields
    """

    final_template = ""
    for field in fields:
        final_template += (templates[3]
                           .replace("{name}", field['name'])
                           .replace("{type}", field['type'])
                           .replace("{value}", field['value']))

    return final_template