Filter based on variables fields

Team,
created simple workflow. in this every task we sent some customized inputs like below.
{
“variables”:
{
“id”: {“value”: “1”},
“created_by”: {“value”: “luckmel”},
“approve_by”: {“value”: “sam”},
“project_name”: {“value”: “test-1”}

} 

}
Here i want to filter based on approve_by =‘sam’… How can i do that? please help

Hi @Learn_Hadoop,

  1. Click on “Add criteria”
  2. Select the criterion “Variable name”
  3. Type “approve_by”
  4. Click on the tick

Does this answer your question?

Cheers,
Tassilo

Thanks for your reply… how can I do it from rest API.

Hi @Learn_Hadoop,

perform a POST request accordingly:
POST /variable-instance (link to docs)

With the following payload:

{
  "processInstanceIdIn": [
    "038324ea-1e3f-11e9-ac4d-5aeae174d7c7"
  ],
  "variableName": "approve_by"
}

Cheers,
Tassilo

I tried … it is giving empty response.

{
“processInstanceIdIn”: [
“my_workflow_1”
],
“variableName”: “approve_by”
}

Hi @Learn_Hadoop,

did you provide the correct processInstanceId?

Cheers,
Tassilo

How to find the process id.

Hi @Learn_Hadoop,

I highlighted the process instance ids in your screenshot:

Cheers,
Tassilo

Instance ,have any option to provide definition id or any unique id which will have process id… what i am looking for each process instance id have variables and contains approve-by. i need to filter based on approve-by=sam

Any update or thoughts

Hi @Learn_Hadoop,

have a look at the REST API documentation:

https://docs.camunda.org/manual/7.10/reference/rest
especially here:
https://docs.camunda.org/manual/7.10/reference/rest/process-instance/get-query/#query-parameters

Here is an example: https://docs.camunda.org/manual/7.10/reference/rest/process-instance/get-query/#example.

Hope this helps, Ingo
Here