ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Workflow.Client.Models Namespace / SearchQuery Class
Members Example

In This Topic
    SearchQuery Class
    In This Topic
    Search criteria for querying job information
    Syntax
    public class SearchQuery 
    Public Class SearchQuery 
    Example
    Search for jobs using a detailed query
    var search = new SearchQuery()
    {
      // Search for all open high priority jobs assigned to users
      Q = "closed=0 AND assignedType='User' AND priority='High'",
      Fields = new List<string> { "jobId", "jobName", "assignedTo", "dueDate" },
      // Sort by job assignment in ascending order and due date in descending order
      SortFields = new List<SortField> 
      { 
        new SortField() { FieldName = "assignedTo", SortOrder = ArcGIS.Desktop.Workflow.Client.Models.SortOrder.Asc },
        new SortField() { FieldName = "dueDate", SortOrder = ArcGIS.Desktop.Workflow.Client.Models.SortOrder.Desc }
      }
    };
    var jobManager = WorkflowClientModule.JobsManager;
    var searchResults = jobManager.SearchJobs(search);
    var fields = searchResults.Fields;
    var results = searchResults.Results;
    Search for jobs using a detailed query with an arcade expression
    var search = new SearchQuery()
    {
      // Search for jobs assigned to the current user using the arcade expression '$currentUser'
      Q = "\"assignedType='User' AND closed=0 AND assignedTo='\" + $currentUser + \"' \"",
      Fields = new List<string> { "jobId", "jobName", "assignedTo", "dueDate"},
      // Sort by job name in ascending order
      SortFields = new List<SortField> { new SortField() { FieldName = "jobName", SortOrder = ArcGIS.Desktop.Workflow.Client.Models.SortOrder.Asc }}
    };
    var jobManager = WorkflowClientModule.JobsManager;
    var searchResults = jobManager.SearchJobs(search);
    var fields = searchResults.Fields;
    var results = searchResults.Results;
    Search for jobs using a simple string
    var search = new SearchQuery() { Search = "My Search String" };
    var jobManager = WorkflowClientModule.JobsManager;
    var searchResults = jobManager.SearchJobs(search);
    var fields = searchResults.Fields;
    var results = searchResults.Results;
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Workflow.Client.Models.SearchQuery

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also