Using Expression Language
The web services
The following objects can support expression language when you use them with placeholders:
-
Response
-
Plan
-
Application
Writing Expression Language
To use expressions in a web services configuration, wrap them with _#
.
Placeholders can be used within an expression. For example:
_#$response.data$.length()_#
One or more placeholders can be used with an expression. For example:
_#$application.city$.concat($application.city2$)_#
Expressions can also be written without any placeholder. For example:
_#'hello'.concat('world')_#
To represent a value in the URL, Header values, and Body sections, you can also use multiple expressions. For example:
"Address" : "_#$application.city$.concat($application.city2$)_# lane name, street name, _#$application.city2$.concat($application.city$)_#"
You can configure consecutive expressions. For example:
_#$application.city$.concat($application.city2$)_#_#$application.city2$.concat($application.city$)_#
To provide a string or literal value, enter it within single quotes ('
). For example:
_#'hello'.concat('world')_#
Supported Operations
The connector supports using expression language for the following operations:

No. |
String operations (Examples) |
---|---|
1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|

The connector supports six relational operators.
Note
[SPACE]
has no impact within the expression for relational operations.
No. |
Relational operators |
---|---|
1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|

The connector supports five arithmetic operators.
Note
[SPACE]
has no impact within the expression for arithmetic operations.
No. |
Arithmetic operators |
---|---|
1 |
|
2 |
|
3 |
|
4 |
|
5 |
|

The connector supports three logical operators.
Note
[SPACE]
has no impact within the expression for logical operations.
No. |
Logical operators |
---|---|
1 |
|
2 |
|
3 |
|
Support for Expression Language in URLs
The web services connector supports expression language in URLs. To use expressions in a URL, wrap them with _#
.
The following objects can support expression language when you use them with placeholders:
-
Response
-
Plan
-
Application
For example:
https://domain.com/2/team/members/list/_#$response.data$.length()_#
/2/team/members/list/_#'hello'.concat('world')_#
/2/team/members/list/_# 5 >= 4_#
Support for Expression Language in the Header Values
The web services connector supports expression language in the Header. To use expressions in the Header, wrap them with _#
.
The following objects can support expression language when you use them with placeholders:
-
Response
-
Plan
-
Application
For example, the following example displays sample key value pairs:
Count - _#2+2_#
Service-Name - _#$application.serviceName$.concat('service')_#
Support for Expression Language in the Body
The web services connector supports expression language in the Body. To use expressions in the Body, wrap them with _#
.
The following objects can support expression language when you use them with placeholders:
-
Response
-
Plan
-
Application
The following example is of a JSON request using expression language in the Body/Payload:
{
"type": "$plan.type$",
"id": "$plan.nativeIdentity$",
"name": "_#'hello'.concat('world')_#"
"size": _#$response.data$.length()_#,
"isActive" : _# 2 >= 2 _#
"externalid": "12345"
}
Do not provide QUOTES outside the expression for values like Boolean and numbers. For example:
{
"size": _#$response.data$.length()_#,
"isActive" : _# 2 >= 2 _#
"count" : _#'Hello'.length()_#
}
The following is an example of an XML request using expression language in the Body/Payload:
<worker>
<fname>_#'hello'.concat('world')_#</fname>
<lname>$plan.lname$</lname>
<size>_#$response.data$.length()_#</wid>
<description> permanent worker</description>
</worker>