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 - perform select count in ifelse block

janice
New Contributor
New Contributor

Hi Team,

We would like to check requestee's customproperties whether there exists the value desired. If yes, then route to approver1, else route to approver2. The query below is used in if-else block, but it returns error and unable to submit the request. 

SELECT COUNT(*) from users u where (u.customproperty10 LIKE '%abc%' or u.customproperty10 LIKE '%efg%' or u.customproperty11 LIKE '%abc%' or u.customproperty11 LIKE '%efg%' or u.customproperty12 LIKE '%abc%' or u.customproperty12 LIKE '%efg%') AND u.id= ${user.id} > 0

Appreciate your help on this. 

8 REPLIES 8

Dhruv_S
Saviynt Employee
Saviynt Employee

Hi @janice 

If you want to check requester's custom properties, you can use the requestedby binding variable. Also since requestor is only one user there is no need to use select count and checking >0, 

You can try something like 

requestedby.customproperty10 == 'abc' or requestedby.customproperty11 == 'efg'

I tested with below condition and it works. You can modify as per your requirement.

requestedby.customproperty10 != null

Regards,

Dhruv Sharma

rushikeshvartak
All-Star
All-Star

Use custom assignment block with Custom query


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

Hi @Dhruv_S  @rushikeshvartak ,

Thanks for your response. May I know whether there is word count limit in the if-else block?

After several testing, I able to use the query below to check the customproperties. However, it works only until customproperty12, and when I add another OR condition for customproperty13, it returns error and unable to submit the request. 

user.customproperty10.contains('abc') or user.customproperty10.contains('def') or user.customproperty11.contains('abc') or user.customproperty11.contains('def') or user.customproperty12.contains('abc') or user.customproperty12.contains('def') or user.customproperty13.contains('abc') or user.customproperty13.contains('def')

CR
Regular Contributor III
Regular Contributor III

share log and ss workflow


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

janice
New Contributor
New Contributor

Hi @CR ,

Please find the screenshot and log attached.

The same requestor is used, and the condition in screenshot ifelse1 is working but it is not working after adding a few lines (highlighted in yellow) in screenshot ifelse2. 

Dhruv_S
Saviynt Employee
Saviynt Employee

Hi @janice 

Could you please check and provide the error message from the logs.

Regards,

Dhruv Sharma

janice
New Contributor
New Contributor

Hi @Dhruv_S ,

Please find attached log and screenshot. 

Create another if else block for remaining condition 


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