Skip to main content
hema.mathivathanan
November 6, 2023
Question

expression rule

  • November 6, 2023
  • 4 replies
  • 0 views

I have an expression rule which returns data for some ID's and for some it returns 0 items. Based on this rule, I need to display a message to the user.
If it returns 0 items, then "in progress". If not, the usual data. 

How to check if the rule returns some value or 0. I used isnullorempty, but it didn't work

    4 replies

    mikes0011
    Brainy
    November 6, 2023

    post code snippet

    November 7, 2023

    Hi hema.mathivathanan , Can you please share your written code. Thanks

    annap0005
    November 7, 2023

    try with this code,

    create a common rule to check isnull or not and use that rule,

    a!localVariables(
    local!keys:getkeysfromdictionary(ri!data),
    local!isAllEmpty: a!forEach(
    items: local!keys,
    expression: a!isNullOrEmpty(index(ri!data,fv!item,null))
    ),
    not(contains(
    local!isAllEmpty,
    false()))
    )

    November 7, 2023

    Hi, for that once have checked for null condition then after that you can add in your code that for if ri!inputNum=0, true, false. In this way you can check for 0 as well