Adding filters to portal report for all process instances

Certified Associate Developer

Hello,

I have portal report created for all process instances, Report data is fetched in process model using execute process report smart service.
Now i want to add aditional filter on report for certain process models name such as Column ="Name" ; operator = "<>" ; Value= "constant(text array of process models name)"
But this filter does not return any value. Whereas when i use Value as single process name, additional filter works properly.

Any input on how i can filter out the multiple process model names?

Thanks,
Kaushik

OriginalPostID-227618

OriginalPostID-227618

  Discussion posts and replies are publicly visible

  • @kaushikr To the best of my knowledge, the "<>" operator shouldn't work and the behavior is expected because the filter value is of type multiple whereas the operator holds good only when the filter value is of type single. Simply speaking, "in" or "not in" are the operators that holds good when the filter value is of type multiple and I believe, Execute Process Report is lacking these operators.

    As an alternate, you may do like this: Add a new column of type Boolean, in the portal report and let's call it as "isAmongDesiredProcessModels?". The value of this column should be fn!contains(cons!MY_LIST_OF_PROCESS_MODEL_NAMES,pm!name). This may either evaluate to true or false in the report for each row. In the Execute Process Report smart service, add a filter on the "isAmongDesiredProcessModels?" column with a definition like this: Column ="isAmongDesiredProcessModels" ; operator = "=" ; Value= true.


    Just in case if you are not aware, I would like to suggest to make use of a!queryProcessAnalytics(), if you are making use of Appian 7.8 or a later version as its much easy and convenient(and also has more options) when compared to Execute Process Report and there isn't a need of going for workarounds(similar to what we did above).

    Please do let us know in case of any follow up questions.
  • I think you are trying to filter out the process instances which do not have any of the names in a given list of names (which is stored in a multi valued constant). So, you are using "Execute Process report Smart Service" which has fields for specifying one filter. (under the "Setup" tab)

    You applied the specified filter, but it did not return any values.
    I suspect the reason is that - the '<>' operator does not work when the value is an array/list. But I am sure it will work if it is a single value (name of a single process model). So, would suggest you to first try with only a single value in the constant (please make the constant single valued first).

    If you find that it works with single values constant, then it is confirmed that the '<>' does not work with multivalued constant.

    If that happens, I would suggest using the "queryProcessAnalytics()" function instead of the Execute Process Report smart service. The reason being - it has many operators. It also has "in", "not in". For your case "not in" is suitable.

    A quick tutorial on "queryProcessAnalytics" can be found here: forum.appian.com/.../Task_Report_Tutorial.html

    It will introduce you to the queryProcessAnalytics function.
  • @kaushikr, if you decide to go with the alternate suggestion given by Sikhivahan of adding a Boolean column with the definition of fn!contains(pm!name, listofProcessModelNames), I would like to make a small suggestion in terms of performance.

    Instead of trying to filter on process model names, filter on process model Ids. The reason - process model ids are integers. Integers are always faster than Strings if you are going to search in them(which is what the fn!contains function does). So, instead create a multivalued constant containing the process model ids instead of process model names if you decide to go by the alternate approach suggested.

    By the way, the better option will be using queryProcessAnalytics
  • @kaushikr, my previous suggestion has a flaw. If you use process model ids, it will definitely be faster. But, process model ids change when you move to another environment. So, it is not a good option.

    This problem will not come with process model names. But, using Strings is definitely performance heavy than using Integers. Also there maybe a problem if somebody creates two process models with the same name.

    So both Strings and Integers (process model names Vs process model ids) have their own drawbacks and advantages. You need not worry about the performance if there are not a lot of process instances.
  • Based on what has been suggested above, I would like to add few things:

    1. a!queryProcessAnalytics() can be used only if and only if Appian 7.8 or a later version is being made use of.
    2. Making use of Process Model Ids works fine if Process Model constants are made use of which are available in Appian 7.8 and later versions. Else it may be tough time to change the values in the constant across the environments when the list is huge.
  • I would like to add to the above explanations made by @chetany that usage of Process Model Ids is a burden on the designer if and only if the Appian's version is 7.7 or earlier. Else this shouldn't be an issue at all and there isn't a need to worry about changes in process model ids.
  • @sikhivahans, I see your point. We can create a constant of type Process Model from version 7.8. And applying tointeger to it gives the process model id. So, even if the constant of Process Model is moved to other environment, it will automatically point to the correct process model Id.
  • 0
    Certified Associate Developer
    @sikhivahans @Chetan Yawale thanks for your valuable inputs, i am trying to use a!queryProcessAnalytics().