Skip to main content
October 5, 2023
Question

A!queryProcessAnalytics() keeps returning 0!

  • October 5, 2023
  • 5 replies
  • 0 views

Hey everyone! I am writing an expression rule to count the rows in multiple task tables so I the user can have the total number of tasks they need to complete on the label for one of the View pages on the record. I have been using a!queryProcessAnayltics().totalcount and I have modeled each of the 8 off of the expression mode code for each of the tables. Unfortunatly I keep receiving 0's when I'm expecting a few on them to have values >=1. Is thre anything right off the bat wrong with my code? Do I need to wrap the code in anything to get the results I want? This is essentially what my code looks like. (I have a rule input called prjId (text value).

a!localVariables(

local!name1: a!queryProcessAnayltics(

                     report: REPORT_NAME,

                     contectProcessModel: {LIST_OF_PMS},

                     query: a!query(

                     pagingInfo: (start, bath, defualt),

                     logicalExpression: a!queryLogicalExpression(

                                                  operator, "AND",

                                                  filters: field: 'c8',

                                                            operators: '=',

                                                             value: ri!prjId,

                                                 )

                          )

                ).totalCount

......

sum(local!name1, local!name2...)

    5 replies

    stefanhelzle0001
    Brainy
    October 5, 2023

    Do you see any error messages returned from a!queryProcessAnalytics()?

    Does this also happen when you strip that down to the most simple query?

    nickk1385Author
    October 5, 2023

    No errors and if I strip it down to one query and remove the .totalCount it returns the data set but just keeps giving me a value of 0

    nickk1385Author
    October 5, 2023

    sorry the screenshot has .totalCount still, but if i removed it there are still no errors

    mikes0011
    Brainy
    October 5, 2023

    What do you see when you just view that report, and provide those three process models as context?

    What result do you get if you run the QPA query by itself, without filtering on "prjId"?