CustomQuery to update with users Manager's Manager

RV
Regular Contributor
Regular Contributor

Can someone please share a query to update a CustomPropertyX on the user profile with their Manager's Manager.

4 REPLIES 4

rushikeshvartak
All-Star
All-Star


update users u ,users m,users mm set u.customproperty1=mm.username where u.manager=m.userkey and m.manager=mm.userkey limit 10;


Regards,
Rushikesh Vartak
If the response is helpful, please click Accept As Solution and kudos it.

rushikeshvartak
All-Star
All-Star

update users u left join users m on u.manager=m.userkey left join users mm on m.manager=mm.userkey on u.customproperty1=mm.username limit 1;


Regards,
Rushikesh Vartak
If the response is helpful, please click Accept As Solution and kudos it.

RV
Regular Contributor
Regular Contributor

I see you have replied two query,  Is the query to try out as it is setting customproperty1 ?

 

update users u ,users m,users mm set u.customproperty1=mm.username where u.manager=m.userkey and m.manager=mm.userkey limit 10;

Both will work . 


Regards,
Rushikesh Vartak
If the response is helpful, please click Accept As Solution and kudos it.