Having problems with an operation's Result and returnResult fields...
1. A SQL Query All Rows operation returns a string, say, "694". 2. In the pre-response scriptlet I read this value using scriptletRawResult['returnResult']). This works fine. 3. In the same scriptlet I then return a Result (using scriptletResult) based on the value of the raw result. (In my case, if the rawResult is "694" I return the string "single", else I return "multi"). 4. In the debugger I see that this has all worked very well!
However, in the Results tab of the same operation I have then assigned a flow variable from Result Field: Result. I expected the flow variable to be assigned with the value "single" but it ends up being assigned "694" - exactly as if I had assigned the flow variable from Result Field: returnResult.
This is functioning as expected. You cannot overwrite the value of a 'Result Field', much as you cannot overwrite a 'Flow Output'.
An iAction returns a bunch of results into predefined result fields (in this case one called "Result"). You can then assign any number of new outputs from this result field but you cannot change the field itself as they are a static object returned to OO via the RAS service.
The scriptletResult you are assigning is just the result value for that step, not the result field called "Result".
If you need this output to say "single" or "multi" you can use a scriptlet filter on that Output instead of in the pre-response scriptlet.