To set a Rule based on a Query follow the steps below:
1. Select "Query" under the Based On category in the Set Rule Basic Information section. The Create a retention rule based on a Query section will open.
2. Write the Query in the Query String box and select "Map Field of Query with the Document ID" from its box and then click Execute Query.
3. Press the OK button and then click Save to save the query.