Creating and validating JSON queries for the getRecordListForTableWithQuery operation
You can use the getRecordListForTableWithQuery operation in your SOAP application code to dynamically filter results. For example, you may want to dynamically filter results when your SOAP application's code calculates a specific text string, range of values, or minimum values to search, which you cannot pre-define in a Helix ALM filter.
Use the Helix ALM Client to create and validate the JSON query string for the operation. This is the easiest way to create a query with correct syntax before adding it to your code. You can also validate existing queries to troubleshoot and correct any errors.
Note: To enable JSON debugging in the Helix ALM Client, choose Tools > Local Options then select the Advanced category. Select Edit JSON query debugging for filters and click OK. See the Helix ALM help for information.
1. In the Helix ALM Client, add restrictions to a filter or advanced find and then click Edit JSON.
The Edit JSON Query dialog box opens.
2. Make any changes to the query if needed.
You can add up to 20 restrictions. You can only add up to four levels of parentheses in one restriction. See Supported restriction types for the getRecordListForTableWithQuery operation and JSON query syntax for getRecordListForTableWithQuery operations for information.
3. Click Validate Query to make sure the syntax is correct.
You can also paste a query in the field and validate it. This is helpful if you already added a query in your code and want to make sure it is correct.
- If the query syntax is correct, the resulting restrictions are displayed in the Filter Criteria area.
- If the query syntax is incorrect, errors are displayed. Correct the query and validate it until it does not return any errors.
4. To add the query to your code, copy and paste it.
5. If you edited the query and want to update the restriction criteria with the query changes in the filter or advanced find, click Save. This option is not available in the View Filter dialog box.
If any restrictions are set to prompt for restriction information when applying the filter, you are prompted to overwrite the existing settings. JSON queries do not support interactive restrictions. Click Save to confirm overwriting the restriction criteria, including the setting to prompt for restriction information. To make the filter interactive again, you must select Prompt for restriction information at run time in any restrictions.