If-Else Logic in Web Service HTTP Operations

The example for the XML body has some copy paste mistakes. $plan.type should be $plan.fname and $plan.lname` or something similar.

The documentation says (for an XML based body):

If the plan does not contain a lname attribute request, the source removes lname value as displayed in the example below:

So <lname>$plan.lname$</lname> will become <lname></lname>.
For account updates, if ISC wants to update the account and update fname but keep lname the same, the plan by default only contains fname, but if the body contains <lname></lname>. Depending on the behavior of the API, some server, interprets this as “The lname should be empty”, causing undesired effects. For such a trivial, often occurring operation we prefer not to use a rule. Is it therefore possible to use if-else logic in the body such that we can say something like this:

<worker>
    #if($plan.hasKey('fname'))<fname>$plan.fname$</fname>#end
    #if($plan.hasKey('lname'))<lname>$plan.lname$</lname>#end
    <wid>$plan.nativeIdentity$</wid>
    <description> permanent worker</description>
</worker>

Then, if the key exists (weather the related value is a new lname or actually is an empty string or null, indicating that the value should be removed) we can ensure that we provision the new value and if it doesn’t that we don’t touch this attribute.

If such logical framework exists in the body, can we please get some documentation on this?

Kind regards,
Angelo

Hi Angelo! Thank you for your input. We’ve created a Jira issue to track the effort and we’ll update the comment thread when it’s been addressed: CONDOCS-3922

Hi Angelo. I completed the work for CONDOCS-3922 by fixing the example to make it clearer and by adding a cautionary note about the connector’s behavior with missing values. I did not document the if-else logic you suggested because the connector does not currently support it. I’ll move this comment to our Idea Discussions category for greater help from the community.