and more in a single search tool across platforms. Read the announcement here. |
03/25/2024 01:56 AM
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
Solved! Go to Solution.
03/25/2024 02:12 AM
Hi @saimeghana , what error do you see in logs?
03/25/2024 03:46 AM
Hi,
It is updating the OU value to customproperty but it is not picking the companyname which is present in User profile.
Thanks,
Sai Meghana
03/25/2024 04:45 AM
@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'
03/25/2024 07:23 AM
Hi Sumathi,
Yes, tried with user.companyname same it is not taking the value of company name
Thanks,
Sai Meghana
03/25/2024 05:08 AM
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
03/25/2024 07:27 AM
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
03/25/2024 07:52 PM
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