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

Need help with enhanced query to populate arstasks comments with request_access comments value

savuser17
New Contributor II
New Contributor II

Hello,

Due to an issue with printing the separate entitlements business justifications in Service Now ticket, we have come up with a workaround to populate the arstasks Comments field with the comments field of request_access Comments field.

The query we have to print the business justification shows like this in data analyser:

savuser17_0-1716897285679.png

However, when we run this in enhanced query, even though it shows both business justifications, it only prints one. So we are trying to find a way to concatenate two rows so that we can print both at once.

So far, tried Group_Concat ( which times out), and String_Agg (which is not allowed to run). Does ay one have any ideas?

This is the enhanced query -

select ra.COMMENTS as arstasks__COMMENTS, ar.taskkey as arstasks__primarykey from arstasks ar, request_access ra where ar.REQUESTKEY = ra.REQUESTKEY and ar.REQUESTKEY = 8536 and ar.tasktype in ('3')

Thanks in advance

7 REPLIES 7

Raghu
Honored Contributor
Honored Contributor

@savuser17  try below working fine my end , add your requestkey condition and try it

Sample :

SELECT
GROUP_CONCAT(ra.COMMENTS SEPARATOR ' ') AS arstasks__COMMENTS,
ar.taskkey AS arstasks__primarykey
FROM
arstasks ar
JOIN
request_access ra ON ar.REQUESTKEY = ra.REQUESTKEY
WHERE
ar.TASKKEY IN ('622205')
GROUP BY
ar.taskkey

 

your query:

SELECT
GROUP_CONCAT(ra.COMMENTS SEPARATOR ' ') AS arstasks__COMMENTS,
ar.taskkey AS arstasks__primarykey
FROM
arstasks ar
JOIN
request_access ra ON ar.REQUESTKEY = ra.REQUESTKEY
WHERE
ar.REQUESTKEY = 8536 and ar.tasktype in ('3')
GROUP BY
ar.taskkey


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

savuser17
New Contributor II
New Contributor II

Hi Raghu,

Thank you for the code - but I tried it and it timed out in data analyser and does the same when I try to save it in the enhanced query too.

May I know what version of Saviynt you are using? And if you have an alternate code?

Thank you

rushikeshvartak
All-Star
All-Star

Because it contains html code it will not work to update. 


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

So there is no way to make the usecase work? Is there any alternative code you can think of?

Add non html code


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

savuser17
New Contributor II
New Contributor II

May I know what is the html part of the code here? Do you have any sample code to refer from?

<span class


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