PARTNERS - Please join us for our upcoming webinar:
Leveraging Intelligent Recommendations for Operational Transformation.
AMS Partners click HERE | EMEA/APJ Partners click HERE

Update Account name into User's CP value using customquery.

Mervinr
New Contributor
New Contributor

Hi All,

Need help in updating the Active directory's account name into any of the custom property values of the user using customquery.

we tried following query it is not working 

UPDATE USERS AS US INNER JOIN user_accounts AS ua ON US.userkey = ua.userkey INNER JOIN accounts AS acc ON ua.accountkey = acc.accountkey SET US.customproperty40 = acc.name Where acc.status = 1 and acc.name not like US.username and acc.endpointkey in (Select endpointkey from endpoints where endpointname like 'Active Directory')

 

thanks

Mervin

4 REPLIES 4

Raghu
All-Star
All-Star

@Mervinr  your query looks like correct , may i know what is error in log? share log

Below only one endpoint applying script u can use direct '=' right

endpointkey in (Select endpointkey from endpoints where endpointname ='Active Directory')


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

Mervinr
New Contributor
New Contributor

Sure,

I have changed from like to = but not luck.

In Application log am seeing below error

java.sql.BatchUpdateException: Data truncation: Truncated incorrect DOUBLE value: 'Manually Provisioned'

Mervinr_0-1714032603365.png

 

 

try below @Mervinr 

UPDATE USERS AS US
INNER JOIN user_accounts AS ua ON US.userkey = ua.userkey
INNER JOIN accounts AS acc ON ua.accountkey = acc.accountkey
SET US.customproperty40 = acc.name Where acc.status  in ('Manually Provisioned','Active','1') and acc.name not like US.username and acc.endpointkey in (Select endpointkey from endpoints where endpointname='Active Directory')


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

Mervinr
New Contributor
New Contributor

Thanks you so much, it works.