GraphQL Feetching Requests

Hello,

I need to find all the current requests that have a common data (customer number for example) which is an IN process data using GraphQl.

Is it possible ? Could you give me an example if yes?

Have a nice day,

Best Regards,
Sara

Hi @sara,

Currently there are two ways:

  1. You can run a query without filtering on the process name. This will return ALL the requests for ALL processes. Then, in your code, you can filter the results to only contain requests that have a customer number value.
    I recommend you keeping the page size to 100 and if you need to display more results, you can execute a second query to search for the second page.
{
  requests(filter:{status:OPEN}, page:{size:100, number: 1}){
    totalCount
    hasNextPage
    items{
      name,
      dataset(filter:{names:["CUSTOMER_NUMBER"]}){
        items{
          name
          textValue
        }
      }
    }
  }
}
  1. Run multiple queries and aggregating all results. If you don’t have a lot of processes that contain that common data, it’s better to run queries only for those specific processes and merging the results afters, this way you don’t have to query unnecessary processes.
{
  requests(filter:{status:OPEN, processName:"PROCESS_NAME_1"}, page:{size:100, number: 1}){
    totalCount
    hasNextPage
    items{
      name,
      dataset(filter:{names:["CUSTOMER_NUMBER"]}){
        items{
          name
          textValue
        }
      }
    }
  }
}

Unfortunately there is no quick way to retrieve only the requests that have a value in this data. If the data is non existant or empty, it will return a null array or an empty value for request’s dataset.

Hope this helps,
Eddy.

1 Like

Thanks Eddy, Have a nice day !

1 Like