and more in a single search tool across platforms. Read the announcement here. |
02/12/2024 11:56 PM
Hi Team,
we have a use case, where we want to achieve if CP40 is updated to '1' then the AD account should be moved to specific OU. I have tried to update the below query in the UpdateAccountJson in the AD connection. However, it gives me errors while updating. could you please suggest, what query should be added in the Update account JSON so that it moves the account to a specific OU based on CP 40's value?
Solved! Go to Solution.
02/13/2024 12:14 AM
Judging by the error message, it's because the object you're using is incorrect.
Try using user.customproperty40 instead of users.customproperty40
Configuring the Integration for Provisioning and Deprovisioning Accounts (saviyntcloud.com)
02/13/2024 12:44 AM - edited 02/13/2024 12:45 AM
Hi,
Can you try this.
{
"moveUserToOU": "${if(Users.customproperty40==1){'OU=user location,OU=Test,DC=Testlab,DC=dev,DC=com'} else {'OU=other location,OU=Test,DC=Testlab,DC=dev,DC=com'}}"
}
Regards, Arvind
02/13/2024 01:08 AM - edited 02/13/2024 02:23 AM
@navneetv Try below samples
{
"moveUsertoOU": "${if(user.customproperty40==1){'OU=user location,OU=Test,DC=Testlab,DC=dev,DC=com'}else{'OU=location,OU=Test,DC=Testlab,DC=dev,DC=com'}}"
}
{
"moveUsertoOU": "${if(user.customproperty40.equals('1')){'OU=user location,OU=Test,DC=Testlab,DC=dev,DC=com'}else{'OU=location,OU=Test,DC=Testlab,DC=dev,DC=com'}}"
}
02/13/2024 02:18 AM
Please can you try below , some time it will expect null check also:
{
"moveUsertoOU": "${if((user.customproperty40!=null) && (user.customproperty40=='1')){'OU=user location,OU=Test,DC=Testlab,DC=dev,DC=com'} else {'OU=location,OU=Test,DC=Testlab,DC=dev,DC=com'}}"
}
02/13/2024 06:27 AM
Hi All,
There is more content in updateaccountJSON, which updates another attribute if we use "else" logic then it will move that user to OU, which is mentioned under the else condition, where the CP40 value is 0. because any update happens CP65 ORCP6 or phone number then update account task will be triggered and where if or else , one of them condition will pass. if its 1 then fine but CP40 is 0 then user will be moved to OU=location,OU=Test,DC=Testlab,DC=dev,DC=com, which we don't want
we want to move the account when cp40 has 1 value. If CP40 is 0 then the account should not be moved
this is my understanding. below is updateAccountJSON which we are using for updating more attributes
{
02/13/2024 07:38 PM
Try below sample
02/13/2024 06:50 AM
@navneetv correct , it is working? above condition after apply?
02/13/2024 07:03 AM
Hi @CR I am looking at the way where account moves when CP40 is 1 and if it's 0 then the account should not move. Not sure, how to achieve this by using an IF and Else condition. I got the above query already from the post which was posted by SumathiSomala.
02/13/2024 08:52 AM
@ArvindKumar How the OU was assigned to the existing users?
is this based on user's field?
02/13/2024 10:51 PM - edited 02/13/2024 10:54 PM
Hi @navneetv
Please try with below query . If you will not use else even it works . same like below query where IF condition will work for your use case . you don't need to define else condition.
"moveUsertoOU": "${if(user.customproperty40.equals('1')){'OU=user location,OU=Test,DC=Testlab,DC=dev,DC=com'}}
Thanks
02/14/2024 12:02 AM
if you dont want if cp40= '0' then you can ignore else condition.
{
"moveUsertoOU": "${if((user.customproperty40!=null) && (user.customproperty40=='1')){'OU=user location,OU=Test,DC=Testlab,DC=dev,DC=com'} }"
}