Hi,
The 'Task' SmartObject is used in the Task List in your K2 Management page. To access it, go to your K2 Management page > Users > Task List. Now this brings me to my next point. You can enable SmartObject logging, play around with the filters you can use in the Task List, then check your SmartObject log (servicepackagein.log) to figure out what is the Regular Filter that is being passed in.
Here are 2 of the Regular Filter input that I have tested:
Filter #1 - Filter tasks from a particular workflow:
[{"ColumnName":"Process Full Name","Condition":"AND","Comparison":"LIKE","ParameterValue":"TestWorkflow"}]
Filter #2 - Filter tasks from a particular workflow, and assigned to a particular user:
[{"ColumnName":"Process Full Name","Condition":"AND","Comparison":"LIKE","ParameterValue":"TestWorkflow"},{"ColumnName":"Destination","Condition":"AND","Comparison":"LIKE","ParameterValue":"K2:denallixadministrator"}]
So to generate this Regular Filter output, you are already in the right direction. Execute the 'Regular Filter' SmartObject's Serialize methd. Fill in the values you want, and it should generate a string similar to the above.
However, the Serialize method only generates the string for 1 filter. If you have multiple filters, you have to use 'Serialize Add Item To Array' method. Fill in the properties except for Serialized Array, then execute. You should notice a string automatically being added into Serialized Array property. Change all your other values, then execute the method again. Each time you do that, it will keep adding more filters to the Serialized Array. Once you are done, you can copy the whole chunk of string from the results panel.
As for why you are getting that error, its because the Regular Filter input property is expecting an array, not an object. If you know your JSON, everything within the {} bracket is a single object. All the objects within an array is enclosed within a [] bracket. How to tell the input is expecting an array? Look at the type next to the name of the property. Regular Filter[].
boringNerd thanks it works like charm
Hello,
I am trying to filter based on ID and its fail for me "Task smart object"
[{"ColumnName":"Id","Condition":"AND","Comparison":"=","ParameterValue":"16107"}]
Use “EQUALS” Text instead of operator {"ColumnName":"Folio","Condition":"AND","Comparison":"EQUALS","ParameterValue":"310112324040000193"}