This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Issue in setting a Function in Response

In the response i am getting a value that needs to be exactly same what i am sending in the request. Now i am trying to set that value as function (i.e- copy from or substring) . When i am selecting particular function in the response for a particular value then all of the remaining values are also changed to what i did for the single one. Here i need to have the function for a particular value only and not for the other values. Kindly suggest me here to provide a solution.

Parents
  • This is happening because your function is under characteristicsValue[] array and the CopyFrom function cannot be currently told to modify only subset of the items. If you need this behavior, you need to use scripting. JavaScript and C# languages are available.

Reply
  • This is happening because your function is under characteristicsValue[] array and the CopyFrom function cannot be currently told to modify only subset of the items. If you need this behavior, you need to use scripting. JavaScript and C# languages are available.

Children
  • Thanks for the suggestion. Can you please share a sample script for this behavior in JavaScript? so that we will follow the same . 

  • In the script, you can use "Script/Insert Path" to interactively select the node you would like to work with and the address will be filled for you.

    The script could look like this:

    hpsv.response.memberSearchResponse.memberSearchResult['Member[]'][0].memberId = hpsv.request.memberSearch.name.firstName;

    Please be aware, that above script is just modifying existing value and the response structure must exist before the code is executed. If you are setting the static response in another rule, you should be OK.