We are delighted to share our new EIC Delivery Methodology for efficiently managing Saviynt Implementations and delivering quick time to value. CLICK HERE.

If statement combined with replace function

TomGarner
New Contributor
New Contributor

I'm trying to do an if statement combined with a replacement of text in a string along these lines in some update user code in an AD connector:

"moveUsertoOU": "${if(accounts.AccountID != 'OU=AnOU,OU=AnOU,DC=domain,DC=domain,DC=net') {user.customproperty24.replace('OU=AnOU', 'OU=DifferentOU')}"

Is what I'm attepmting possible? I get this error currently:

Error while Update operation for account-abele1.ea in AD - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript4316.groovy: 2: expecting ''', found '\n' @ line 2, column 179. ers,', 'OU=DifferentOU'}\", ^ 1 error Error while Update operation for account-user in AD - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript2939.groovy: 2: expecting ''', found '\n' @ line 2, column 179. ers,', 'OU=DifferentOU'}\", ^ 1 error

Is there another method that Saviynt supports that I'm not aware of?

Thanks

3 REPLIES 3

Dhruv_Sharma
Saviynt Employee
Saviynt Employee

Hi @TomGarner 

From the error in the logs, it seems that there is some syntax errors here. 

Also could you please elaborate what exactly you are trying to do here.

moveUsertoOU value should have an expression which evaluates to an OU. But you are trying to replace something in CP24. I am not able to understand how would this expression evaluate to an OU finally.

Regards,

Dhruv Sharma

 

TomGarner
New Contributor
New Contributor

We need to take the value in CP24 and replace an OU value with a different one and move it accordingly.

I actually have this functionality working now.

However I need to modify the if condition to instead look for a complete match and instead search the string for a matching value.

I've tied swapping != for notcontains but Saviynt is giving me the same error as before.

Share current config 


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