Skip to main content
November 17, 2022
Question

rule which gives me a list of users whose last login date was a year back

  • November 17, 2022
  • 1 reply
  • 0 views

Hi,

Can Someone help in writing a rule which gives me a list of users whose last login date was a year back.

I wrote this rule but it is pulling users with the lastlogin date as null. Please correct me

a!forEach(
  expression: if(todatetime(getuserlastlogin(fv!item)) 
              < ri!datetime,fv!item,""),
  items: getdistinctusers(cons!PDS_USERS_TYPE)
)

Thanks in Advance

    1 reply

    daniell
    November 17, 2022

    Hi, try adding an addition condition within your "expression" of forEach. First, check if the user last login is null, and if it is then don't return the user. If there is a last login date, then do the check to see if it is < ri!dateTime.