07/06/2023 05:16 AM
Hello Everyone,
In the query below I am fetching the approvers based on users(requestees) cp19 and the dataset is built like
Company | Approvers |
CompA | testA@domain.com |
CompB | testB@domain.com |
CompC | testC@domain.com |
So I have written a query in customquery block of the workflow as follows which is working fine in the data analyzer if I replace ${REQUESTEE} with a hardcoded userkey value, but it is failing the workflow. Kindly help me if possible that how do I get the userkey for the requestee in the workflow-->
select distinct u1.userkey from dataset_values,users u1, users u2 where dataset_values.datasetname = 'Sample_Approvers' AND u1.email=dataset_values.attribute2 and u2.customproperty19 = dataset_values.attribute1 and u2.userkey = ${REQUESTEE}
Solved! Go to Solution.
07/06/2023 06:12 AM
Hi @shubhangsinha_ ,
Can you try the below query:
select distinct u1.userkey from dataset_values,users u1, users u2 where dataset_values.datasetname = 'Sample_Approvers' AND u1.email=dataset_values.attribute2 and u2.customproperty19 = dataset_values.attribute1 and u2.username = '${user.username}'
Workflow Components (saviyntcloud.com)
Thanks,
Armaan
07/06/2023 07:59 AM
Try below logic
select distinct u1.userkey from dataset_values,users u1, users u2 where dataset_values.datasetname = 'Sample_Approvers' AND u1.email=dataset_values.attribute2 and u2.customproperty19 = dataset_values.attribute1 and u2.userkey = ${user.id}
or
select distinct u1.userkey from dataset_values,users u1, users u2 where dataset_values.datasetname = 'Sample_Approvers' AND u1.email=dataset_values.attribute2 and u2.customproperty19 = dataset_values.attribute1 and u2.username = '${user.username}'
07/06/2023 10:39 PM
Thank you so much, it worked