Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Unable to use datediff function via User update rule to Enable User accounts

Uzair
New Contributor
New Contributor

Hello,

We have a scenario wherein If a user is terminated his accounts will be disable (Disable User Account),
If the user returns to the organization within 14 days his accounts should be Enabled (Enable User Account).

Disable user Account user update rule is working as expected, we're facing issues wrt Enable user account.


We are running the following User Update Rule, but it doesn't create a Enable Account task 

Uzair_1-1678720548555.png

This gives us a successful preview with the user we intend to target and test on.

We tried to use datediff in a different format too with successful preview but it didn't create a task to Enable user account 

Uzair_2-1678720662877.png

 

But, when we remove the datediff function, we were able to successfully generate a task to Enable User account.

Uzair_3-1678720807179.png

Please can you help us resolve the issue ?

Thanks and Regards, 
Uzair

 

3 REPLIES 3

ParitaSavla
Saviynt Employee
Saviynt Employee

Can you please try with the below condition.

datediff(a.enddate,now()) <= 14

There needs to be a space before and after "<=" so that the operator is saved correctly. 

If you use datediff(a.enddate,now()) <=14 as shared in the screenshot, it will get saved as datediff(a.enddate,now()) &lt;=14 and will not perform the intended operation. 

Hence can you try with the suggested syntax of datediff(a.enddate,now()) <= 14

Also, users table is given the alias as a. Hence, while referencing any user attribute in user update rule use it as a.enddate, a.firstname etc.

Vidhya
New Contributor III
New Contributor III

Could you please tell me for accounts table what is the alias?

Uzair
New Contributor
New Contributor

Thank you for your valuable suggestion, we were able to run the User Update rule successfully.

But as suggested when we used alias as a (Eg: a.statuskey or a.usersource), this wasn't creating a task 
Without using the alias we were able to generate the task