- The next step is to create the input controls that will be used to provide this cascading behaviour. The first input control to create is the Course Categories one.
- When logged into Zoola, follow this URL (https://zoola.io/app/flow.html?_flowId=addInputControlFlow&ParentFolderUri=%2FReports) to be taken to the Create Input Control workflow.
- In the Type field, select Multi-Select Query.
- In the Prompt Text field, enter "Course Categories".
- In the Parameter Name field, enter the Parameter ID for the Course Categories ID filter in your Report: "course_category_id_1".
- After the optional Description field, ensure that the Visible option is checked.
- Click the Next button. The Locate Query page appears:
- Select Define a Query in the next step, as you will be entering a new unique query instead of selecting an existing one.
- Click the Next button. The Name the Query page appears:
- Enter "Course Categories" in the Name field (the Resource ID field will auto-populate).
- Click the Next button. The Link a Data Source to the Query page appears:
- Select the Select data source from Repository option.
- Click Browse and identify the Totara data source (Public > Moodle/Totara > Data Connections > Totara), then click Select.
- Click Next. The Define the Query page appears:
- From the Query Language list, select SQL.
In the Query String field, enter the following query:
select id, name, concat(repeat(concat(' ', char(59 using utf8)), (depth-1)*2), name) as hierarchy_name from mdl_course_categories order by sortorder
click the Save button. The Save Parameters page appears:
In the Value Column field, enter "id". This enables the Input Control window to present values based on the ID fields from the mdl_course_categories table.
In the Visible Columns field, enter "name" and click the Add button. This enables the Input Control window to present the ID fields by their associated name. In this case, this will display the Course Categories by their proper names instead of their IDs.
Click the Submit button.
Proceed to Creating the Cascading Courses Input Control.