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

can we pass the Dynamic value in Userimport json via Database connector

saimeghana
Regular Contributor
Regular Contributor

Hi Team,

We are trying to update the customproperty based on the country. In customproperty will store the OU value and in the OU we have to pass the dynamic value.

Example:

select username,
case when customproperty3='00' then 'OU=Comptes Actif,.................,DC=net'
When country='BE' && CompanyName like 'abc%' then 'OU=End-user Accounts,OU=Users,OU=${user.companyname},OU=BUs,DC=net'
else ' '
end as customproperty5
from users where username !='PLACEHOLDER_IDENTITY' and username='acsavtest.user0503'

Please could someone help me to complete this, it's urgent. 

Thanks,

Sai meghana

7 REPLIES 7

NM
Regular Contributor III
Regular Contributor III

Hi @saimeghana , what error do you see in logs?

saimeghana
Regular Contributor
Regular Contributor

Hi,

It is updating the OU value to customproperty but it is not picking the companyname which is present in User profile.

saimeghana_0-1711363541448.png

Thanks,

Sai Meghana

@saimeghana Did you try below?

select username,
case when customproperty3='00' then 'OU=Comptes Actif,.................,DC=net'
When country='BE' && CompanyName like 'abc%' then 'OU=End-user Accounts,OU=Users,OU=user.companyname,OU=BUs,DC=net'
else ' '
end as customproperty5
from users where username !='PLACEHOLDER_IDENTITY' and username='acsavtest.user0503'

 

Regards,
Sumathi Somala
If this reply answered your question, please Accept As Solution and give Kudos.

Hi Sumathi,

Yes, tried with user.companyname same it is not taking the value of company name

Thanks,

Sai Meghana

PremMahadikar
Regular Contributor III
Regular Contributor III

Hi @saimeghana ,

Could you please try below query:

 select username, case when customproperty3='00' then 'OU=Comptes Actif,.................,DC=net' When country='BE' && CompanyName like 'abc%' then concat('OU=End-user Accounts,OU=Users,OU=',${user.companyname},',OU=BUs,DC=net') else ' ' end as customproperty5 from users where username !='PLACEHOLDER_IDENTITY' and username='acsavtest.user0503'

 

If this answers your question, then consider selecting Accept As Solution and hit Kudos

Hi Prem mahadikar,

Tried with the concat() function as well it is showing the below error.

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 '{user.companyname},',OU=BUs,DC=emea,DC=net') else ' ' end as custo' at line 3

Thanks,

Sai Meghana

select username, case when customproperty3='00' then 'OU=Comptes Actif,.................,DC=net' When country='BE' && CompanyName like 'abc%' then concat('OU=End-user Accounts,OU=Users,OU=',ifnull(u.companyname,0),',OU=BUs,DC=net') else '' end as customproperty5 from users u where companyname is not null


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