• A new version of Full Calendar is now available.

    See the details here

Lists

  • Views Views: 73,624
  • Last updated Last updated:

Navigation

  • Introduction​

    Lists allow you to display data collected by your Forms, or from existing database tables.

    Fabrik lists should be considered as views onto the data contained within MySQL tables. This is because with Fabrik lists you can:

    • Create joins between database tables.
    • Have multiple Fabrik lists pointing at the same database table.
    • Each Fabrik list may then apply its own access levels and filtering to alter the display of the underlying database table's data.

    Lists​

    To access the lists section select components > fabrik > lists.

    You will see a page containing all of your Fabrik lists similar to the diagram below:

    list-list.png


    Each list can be selected with the check box to the left of its name. Once selected it can be altered by clicking on the buttons at the top of the page:

    • New - allows you to create a new list
    • Edit - edit the list, note that you can also edit the list by clicking on its name
    • Copy - copies the list
    • Publish - sets the state of the list to published (note that the list's start and end publish dates still need to be correctly set up for the form to be visible to your users)
    • Unpublish - sets the list's state to unpublished
    • Import - allows you to import a CSV file to create a new database table and Fabrik list
    • Trash- trashes the list (you must select Status=Trashed + then "Empty trash" to delete the list)
    • Options - allows you to set up Options used through out Fabrik
    For each list you have a couple of links:

    • Element - Add an element to the list's first group.
    • Form edit - takes you directly to the form edit page.
    • View data - Shows the data contained within the fabrik list, allowing you to add edit and delete records.
    • Published - toggles the list's published state
    • View details - shows a list of the list's Forms and Elements.
    The table list can be filtered with the use of the two fields that appear directly above the table headings.

    Deleting a List​

    To delete a list check the checkbox next to its name in the table list and press the trash button. Then filter the list view on Filter: trashed, to show the lists located in the trash. Finally to delete the list select it and press the delete button. You will then be presented with this page:

    list-delete.png

    The list below the title shows the tables you previously selected for deletion.

    Next you have two choices to make:

    • Which associated Fabrik sections you wish to delete with the list. To fully remove the table and all its parts select "Delete lists, Forms, Groups and Elements
    • Whether you would like to delete (a.k.a drop) the database table that the Fabrik list was using as its data source. Note that any Joomla table with the Joomla prefix (normally jos_) will never be removed by Fabrik. This is to ensure you don't remove core tables that Joomla relies upon.
    Once you are happy with your selections press the save button.


    Importing a CSV file to create a new list​

    You can create a new Fabrik list by importing an CSV (comma separated variable) file. To access this screen click on the Import button on the table list page. You will then see a form as shown below:

    list-csv-import-new.png

    • CSV file - press the browse button to locate the CSV file on your hard drive (excel and open office spreadsheets can be exported as CSV file)
    • Connection - select the Fabrik connection in which you want to create the database table
    • DB table name - enter the name of the database table you wish to create when importing the CSV file. Must be alphanumeric with no spaces.
    • List label - enter a label for the Fabrik list.
    • Create primary key - if yes selected then an additional primary key element will be added to the imported table.
    • Field delimiter - the character used to delimit each column's data
    • or Tab delimiter - if checked overrides 'Field delimiter' and sets the delimiter to be a tab
    • Text delimiter - The character used to quote strings.
    • Press continue to continue with the creation of the Fabrik list from the uploaded CSV file.
    • Press cancel to abort this page and return to the list view
    If you had selected 'yes' for the 'create primary key' option then the next screen will look like this. Here you can set the element type for each imported column and define the element's label

    Note: CSV import is not going to work if your list has joined data. CSV files by their nature represent a information about a single row of data, it doesn't contain relationship information and thus we would find it very hard to guess the implied relationships in the CSV data when it comes to re-importing it back into a relational database.

    list-csv-import-pk.png


    If you had selected 'no' for the 'created primary key' option then you will see an additional column as shown in the image below:

    list-importcsv-createlement.png


    The Primary key radio list allow you to specify which element is the primary key.

    • To continue with the import press the save button, this will create the table, form, group and Elements, create the database table and import the CSV data into the table.
    • To cancel the import press the cancel button
    Important note for Mac users
    To avoid pulling your hair out when trying to use this great feature, you have to look for the following issue regarding Excel for Mac (at least in the office 2004 version - newest releases may have corrected the problem): Excel for Mac does not export a CSV usable with the Fabrik import feature because

    • The line breaks are Classic Mac (CF), which is not recognize by Fabrik which will try therefore to create new Elements with ALL the records in your file. The line breaks should be set to Unix (LF)
    • The fields are not seperated with double quote marks (), which causes Fabrik to not importing anything
    Your best solution therefore, if you need to import an Excel file into a Fabrik table, is to open this file into Open Office(latest version 3.3.0 at this moment), then save it to CSV, using save as and CSV text (.csv) as type of file.You will prompted to an exportation preferences window. The default settings should be correct:

    • Unicode UTF-8 for character encoding
    • ',' as field seperator
    • as text separator
    The CSV produced can then be imported correctly into Fabrik, following the procedure above.
Back
Top