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

Workflow condition IF-Else Evaluation With SQL Queries

New Contributor II
New Contributor II


We have a requirement where while requesting for AD service-acccount , end-user will provide the sAMAccountName. We have configured the sAMAccountName as dynamic attribute on Service Account Request Form. The request should get rejected if provided sAMAccountName is already exists in AD.

We want to use below condition in if/else block with groovy as expression language if outcome of this block is true then request should get rejected.

SELECT IF( EXISTS(SELECT name from accounts where name = dynamicAttributes.get('sAMAccountName')), 1, 0)

Please suggest the right syntax.  

Any assistance with this matter would be greatly appreciated.

Thank you,



Valued Contributor
Valued Contributor

Hi @SnehalW

SQL Queries are not supported in If/Else Condition of workflows.

However, your requirement seems that you need to check that the account Name is unique for Service Account request.

To match this requirement, I would suggest you to use the Account Name Rule at Endpoint level, and define a rule that will make the account name (and therefore the sAMAccountName) unique.

Can you also elaborate on why end users should enter themselves the sAMAccountName during request ?