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

Dynamic Attribute - Single select from SQL query issue

itinjic
New Contributor III
New Contributor III

I have issue with one dynamic attribute in which I us a query like the one below :

SELECT CONCAT(LASTNAME,"somecharset, ", FIRSTNAME," (",
    IF(${customDynamicAttribute1} = 'Somevalue 1' AND ${customDynamicAttribute2} like 'XX%','XX-Some Value 1',
        IF(${customDynamicAttribute1} = 'Some value 2' AND ${customDynamicAttribute2} like 'XX%','XX-Some value 2',
        IF(${customDynamicAttribute1} = 'Some value 2' AND ${customDynamicAttribute2} AND ${customDynamicAttribute3} != 'Some value 3' not like 'XX%','Some value 2','Some value 2')
        )
    ),")"
) AS ID FROM USERS WHERE USERKEY = ${requestee}


in this query I use information from other dynamic attributes and data from the user object for whom the request is created, such as firstname and lastname. 


The issue is that this query does not return anything and when the request is created this dynamic attribute is empty?
2 REPLIES 2

rushikeshvartak
All-Star
All-Star

Share logs


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

NM
Regular Contributor III
Regular Contributor III

Hi @itinjic , Try using CASE instead of If.