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

Enhanced Query for JOB to Update Account CP based on dataset value

prasadpatil16
New Contributor III
New Contributor III

Hello Experts,

I need help in developing enhanced query for below senario,

We have dataset with Department, country and Role. we want to update the XYZ app Accounts CP10 attribute based on camparing users Department and Country with Dataset Department, country  and result of roles need to be updated in value of CP10.

I have tried below query for single user and need help to build it for all users

SELECT (select GROUP_CONCAT(d.attribute3) from dataset_values d where datasetkey=5 and attribute1=(select ud.departmentname as id from users ud where ud.userkey=22) and d.attribute2=(select ud.customproperty1 as id from users ud where ud.userkey=22)) AS ACCOUNTS__CUSTOMPROPERTY10,a.accountkey as accounts__primarykey FROM ACCOUNTS AS a where a.ENDPOINTKEY = 203 and a.name = 'XYZ'

Please let me know if any additional information is required.

Thanks,

Prasad

1 REPLY 1

rushikeshvartak
All-Star
All-Star

Can you share sample output from data analyzer

SELECT a.accountkey AS accounts__primarykey,
(SELECT GROUP_CONCAT(d.attribute3)
FROM dataset_values d
JOIN users ud ON d.attribute1 = ud.departmentname AND d.attribute2 = ud.customproperty1
WHERE d.datasetkey = 5
AND ud.userkey = a.accountkey) AS ACCOUNTS__CUSTOMPROPERTY10
FROM ACCOUNTS AS a
WHERE a.ENDPOINTKEY = 203
AND a.name = 'XYZ';


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