         for i in [0..(@values.length - 1)]
             values.push @getFieldValues i
         values.push {}
+
         @values = values
-
         @render()
         @$('#add-button').hide() if @values.length > 4
 

        @paths = options.paths or [ path: '/', id: '']
        @listenTo @model, 'change', @render


    # Build fields
    afterRender: =>

        slug = @model.get 'slug'
        @values ?= @model.get('accounts') or [{}]
        errorMessage = @model.get 'importErrorMessage'

        @$el.addClass "konnector-#{slug}"


        for name, val of @model.get 'fields'

            id = "##{slug}-#{name}#{index}-input"
            # For folder fields, it requires to convert the value (a folder
            # id) to a folder path.
            if val is 'folder'
                fieldValues[name] = @getFolderPath slug, name, index
            else if val is 'link'
                fieldValues[name] = $(id).attr 'href'
            else if val is 'label'
                fieldValues[name] = $(id).text()
            # For simple fields, just get the value of the field.
            else
                fieldValues[name] = $(id).val()
        fieldValues


