Create a query for third-party applications

Use this procedure to create a query for accessing Aspen data via an API with a third-party application. Once a query is created, you can copy, modify, or delete it.

Note: You can also export and import queries.

To create a query:

  1. Log on to the District view.
  2. Select Tools > Queries.
  3. Select Options > New Query.
  4. Use the following table to complete the fields.
    FieldDescription

    Query name

    Type a descriptive name for the query.

    Root table

    Use the drop-down to select the root table that has the field or fields you want to access. Click Set.

    Related tables

    If you want to join a related table, select it in the Related tables field, and then click Join.

    Selected tables

    This field is automatically populated when you set the Root table or add Joined tables.

    Available fields

    Use the drop-down to select the field you want to use based on the table selected above.

    Output fields

    Click Add to populate this field based on the selection you made in Available fields. Repeat until all required fields are in the list.

    Filter fields

    Click Filter to open the New Query Filter pop-up. Enter a Parameter Name, select an Operator, and then click OK. Repeat to create multiple filters.

    Example: If you are querying to determine who is buying lunch, you might look for the value in the Buy Lunch field on the Student Lunch table. The parameter in this case would be Y, and the operator would be Equals.

    Sort fields

    If you have more than one field you are collecting data from, you can determine their order using this field. You can create multiple sort fields. You can also create 'nesting' sorts within a sort field.

    Security roles

    Use the drop-down to select a security role. Click Add to apply the security role you selected. The security roles should match the roles the user has in the OAuth access point. You can select several roles. The role(s) should be specific to the API you are connecting with.

    Selected roles

    This field is automatically populated with your selection in the Security roles field.
  1. Click Save.

After a query is created, it can be copied, modified, or deleted. Click the query to access its details page, and then do one of the following.

  • To copy a query: Select Options > Copy Query. On the pop-up, you can change the name of the query, edit the other fields as needed, and then click Save.

  • To modify a query: Select Options > Modify Query. On the pop-up, edit the field(s) as needed, and then click Save.

    Note: To modify a query, the user must have the appropriate security role privileges for the system table(s) they want to modify.

  • To delete a query: Select Options > Delete. A warning message displays the related records that will be deleted if you proceed. Click Continue or Cancel.

You can also export and import queries.