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

Extract values from multiple select from SQL query dynamic attribute

tanvi_gaikwad
New Contributor II
New Contributor II

Hello Saviynt Team, 

We have a dynamic attribute of type SQL MULTISELECT. The values are stored in a customproperty as comma separated values. 

Is there any way we can separate out each of these values and store them in remaining custom properties?

We had tried to use the split function in Data Analyzer, but it gives Access Denied error. Another approach we were looking into was creating a user update rule using custom action. 

Looking forward for solutions. 

15 REPLIES 15

rushikeshvartak
All-Star
All-Star

Its not supported. You can use only 1 account column at a time.


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

tanvi_gaikwad
New Contributor II
New Contributor II

Is there any way we can use the User Update Rule. This rule will be triggered when the user is created from UI, and will check if the attribute value has comma-separated values. If yes, then a custom action will be called. According to the documentation, we need a class name and a method name. From where do we create this custom jar?

You need to create custom jar and upload under - settings - External Jar section


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

HI Rushikesh, we are not able to locate the External JARS section under Settings. Can you provode exact location?

rushikeshvartak_0-1708062038221.png

 


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

Many thanks for the response. Also, can you provide a sample JAR file for us to refer?

tanvi_gaikwad
New Contributor II
New Contributor II

Hello Rushikesh, 

One DA is having multiple comma separated vales. How can we split those values using SQL query.

We are looking at something like this ->

select * AS ID  from users STRING_SPLIT(customproperty5 , ',') where username='adminsmita'

customproperty5(can have any number of comma separated values) = Garry and Warren Smith Honda,GWS Peninsula Honda,Pakenham Honda

Expected output->

  • Garry and Warren Smith Honda
  • GWS Peninsula Honda
  • Pakenham Honda

Thanks.

SELECT value AS ID
FROM STRING_SPLIT((SELECT customproperty5 FROM users WHERE username = 'adminsmita'), ',')


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

Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '((SELECT customproperty5 FROM users WHERE username = 'adminsmita'), ',')) as sav' at line 1

SELECT Substring_index(Substring_index(customproperty5, ',', 1), ',', -1) as id
FROM   users where username = 'adminsmita'
UNION
SELECT substring_index(substring_index(customproperty5, ',', 2), ',', -1) as id
FROM   users where username = 'adminsmita'
UNION
SELECT substring_index(substring_index(customproperty5, ',', 3), ',', -1) as id
FROM   users where username = 'adminsmita'
UNION
SELECT substring_index(substring_index(customproperty5, ',', 4), ',', -1) as id
FROM   users where username = 'adminsmita'
UNION
SELECT substring_index(substring_index(customproperty5, ',', 5), ',', -1) as id
FROM   users where username = 'adminsmita'
UNION
SELECT substring_index(substring_index(customproperty5, ',', 6), ',', -1) as id
FROM   users where username = 'adminsmita'
UNION
SELECT substring_index(substring_index(customproperty5, ',', 7), ',', -1) as id
FROM   users where username = 'adminsmita'
UNION
SELECT substring_index(substring_index(customproperty5, ',', 8), ',', -1) as id
FROM   users where username = 'adminsmita'


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

tanvi_gaikwad
New Contributor II
New Contributor II

Thank you Rushikesh for the response. This is working.

One query, this will work only of the max we have are 8. It will not work for selections more than 8?

Yes keep adding union 


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

tanvi_gaikwad
New Contributor II
New Contributor II

Hello Rushikesh, 

We have requirement of splitting string having more than 35 comma separated values. We already tried it with 5 select/union statements and it's affecting server performance. it's very slow and taking time to load user creation form. So is it right to go ahead with same approach? or do you have any other alternative?

There should be a way to handle the options selected in the 'Multiselect from query DA'

There is no alternative. Store in multiple customproperties


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