pub.string:substitutePipelineVariables doesn't substitute value for variable in Document List

Hi,

I need help in using pub.string:substitutePipelineVariables for variables present in document list. This service is not substituting field value present in document list.

Example:

Document list A[0] has string B with value “gg”

while invoking service:
input:
inString: %A[0]/B%

Output:
value: %A[0]/B%

Expected value is “gg”