Note: This documentation is for Moodle 2.7. For up-to-date documentation see Dataform search sort.

Dataform search sort

From MoodleDocs


Using filters

Provided the activity creator has added the filtering options to the view, you can filter and sort the displayed list of entries by

  • applying a predefined filter (if exist)
  • using the quick search and per page options (Quick filter)
  • creating and applying your own advanced filters (My saved filters)

df-filter-display-menus.png

All filters are available from the filters menu dropdown. To apply a filter, select the desired filter from the list. To un-apply the currently selected filter, select 'Choose...'.

df-filter-display-menu-options.png

The Quick filter

To display only entries that contain a certain text content in any of the (view) fields enter the text in the 'Search' input box and press Enter. This will create the Quick filter (or update it if it already exists) and apply it to the view (the Quick filter will show as selected in the filters menu). If you want to clear the search criterion from the Quick filter, clear the input box and press Enter.

To display only a certain number of entries per page, select the desired number in the Per page dropdown. Similar to the 'Search', a Quick filter will be created (or updated) and applied. If you want to clear the paging from the Quick filter, select 'Choose...' in the 'Per page' dropdown.

You have only one Quick filter and it is updated whenever you use the 'Search' and 'Per page' options. If you want to completely remove the Quick filter from the list, select '* Reset quick filter' in the filters menu.

The Advanced (user) filter

If Advanced filters are enabled in a view you can click the 'Advanced filter' link to open the advanced filter form. You can edit one of your saved advanced filters by first applying it to the view and then clicking the 'Advanced filter' link.

The advanced filter form allows you to add sort and search criteria on the view fields. In most cases you search/sort the field content. Some fields may have more than one search/sort element.

To define a sort criterion select the field element and the sort order (ascending|descending). The sort order dropdown of the criterion is disabled until to select the element. You can define multiple criteria and input fields for further criteria will be added to the form after filling the displayed ones and saving changes.

To define a search criterion:

  • select AND|OR – Retrieved entries will match all AND criteria and at least one of the the OR criteria.
  • select field – Field element.
  • select IS|NOT – With NOT only entries that do not match the criterion will be retrieved.
  • select operator
    • Empty
    • Equal
    • Greater than
    • Less than
    • Greater or equal
    • Less or equal
    • Between
    • Contains
    • In
  • Enter search string – See list below for special search string formats in some fields.

When editing a saved filter you can either update that filter or add a new filter. You can save up to 5 filters per view. Adding further filters will drop older ones from the list.

df-filter-advanced-form.png


Searchable/Sortable fields

This list includes only internal and standard fields. For search/sort options of add-on fields please consult the respective field's page.

Entry actions N/A
Entry author
  • Current user – (search only) matches entries authored by the current user.
  • User first name
  • User last name
  • User username
  • User id number
Entry group
  • Id number
Entry time
  • Time created
  • Time modified

The search value is a string containing an English date/time (including relative date/time such as 'tomorrow'). You can specify a range (for the BETWEEN operator) by entering “from” and “to” dates separated by two dots (..), for example:

3 March 2014 .. 10 March 2014 
Checkbox
  • Content
Comment Mdl N/A
Entry state
  • State

The field is sorted by the state keys, not the state labels.

The search value is a string containing a state label.

File N/A
Number
  • Content
Picture N/A
Radio button
  • Content
Rating Mdl
  • User rating
  • Number of ratings
  • Average of ratings
  • Sum of ratings
  • Highest rating
  • Lowest rating
Select
  • Content
Select (multiple)
  • Content
Text
  • Content
Text area
  • Content
Time
  • Content
Url
  • Content