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 IF-Else Evaluation of SQL Queries

chandu_k09
New Contributor III
New Contributor III

Hello Everyone,

Is it possible to run SQL queries in the Workflow If/Else condition block where we need to access some values in the dataset, then if the values are present then we can return true or false. 

Here's what I am trying to run "select distinct u1.userkey, u1.username, dataset_values.ATTRIBUTE1, dataset_values.ATTRIBUTE2 from dataset_values,users u1, users u2 where dataset_values.datasetname = 'External_Approver' AND u1.email=dataset_values.attribute2 and u2.companyname = dataset_values.attribute1 and dataset_values.attribute1='${user.companyname}'"

Requirement is to check if there are any approvers available where from the dataset approver list there are some approvers who's companyname = requestee.companyname. If yes, then approve. Else, if no approvers were matched, then reject.

See attachment for what I've tried to do. 

3 REPLIES 3

nimitdave
Saviynt Employee
Saviynt Employee

@chandu_k09 no, its not possible to use sql queries in the if-else block.

But you can try leveraging custom assignment block and assign to a requestor id condition fulfill else to another users.

rushikeshvartak
All-Star
All-Star

What is error you are getting ?


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

chandu_k09
New Contributor III
New Contributor III

Hi Rushikesh,

I don't see any particular error in the logs. But I can tell workflow isn't working because the request gets submitted to the user manager which is not what the query does. Also sometimes this error shows "The server encountered an error and cannot complete your request". I've made sure the workflow is approved, loaded and assigned to security system. 

chandu_k09_1-1692810329396.png

Is it default behavior that if there is an error in the query/workflow the request goes to manager?