Can't set a variable in an outbound REST message

HugoFirst
Kilo Sage

I'm working on an integration with xlRelease and I have an outbound REST message which works with a static text string for the content.

I places a variable in the content string so that it can be substituted before the message is sent. I placed the text   ${hosts} in the content and created a "Test Substitution" entry with a value of alpha,beta,gamma.

Yet when I test the REST message, the content contains the text: ${hosts} and not the value of alpha, beta,gamma.

Can you give me advice on how to make this happen?

I'm including a screen dump of the rest message with the variable and test variable substitution highlighted.

find_real_file.png

1 ACCEPTED SOLUTION

I found the problem and have it working.   The issue turned out to be the quotes immediate prior to and following the variable in the content string.


I think this is unfortunate, but it is a fact.   To sum up:



A string like this will NOT work:


...{"hostList": "${hosts}"},"...



A string like this WILL work:


...{"hostList": " ${hosts} "},"...



I just have to be sure that xlRelease parses out the leading and trailing blank on the value I send it.


View solution in original post

2 REPLIES 2

HugoFirst
Kilo Sage

FWIW: I read the doc: Variable substitution in outbound REST messages and I think I'm following its advice....


I found the problem and have it working.   The issue turned out to be the quotes immediate prior to and following the variable in the content string.


I think this is unfortunate, but it is a fact.   To sum up:



A string like this will NOT work:


...{"hostList": "${hosts}"},"...



A string like this WILL work:


...{"hostList": " ${hosts} "},"...



I just have to be sure that xlRelease parses out the leading and trailing blank on the value I send it.