Hi,
I am using a Execute Stored Procedure smart service and it is returning 2 result set and each result set is returning with multiple values.
Now, when I try to grab the store procedure output result into a variable like below, I am getting an error.
An error occurred while evaluating expression: keys:AC!ResultSets[0] (Invalid index (0) for list: valid range is 1..2) (Data Outputs)
Discussion posts and replies are publicly visible
The first item in an Appian list or array is at index 1, not zero.
I tried with index 1, error gone, but no luck with the values.
Below are the screen shots of my stored procedure output along with Appian PM. I am unable to capture these array of values. Anything wrong in my settings.
Can you store ac!ResultSets in a pv! and show us the value of that pv! in a new instance?
I suggest to call that SP in an interface and store the result to a local variable. This is super fast to debug and understand the returned data.
Unknown said:I suggest to call that SP in an interface
I'd go one step further and suggest wrapping it in an expression rule. Once that rule is up and running (and this is very easy to test as needed), you can use it anywhere easily - interface, process model, etc.
If I test using expression rule inside Expression Rule, I found that result/ (o/p) is of type Map. Not sure if I have convert this to any other type before saving to pv variable for further use.
You were trying to store this result in a pv! of Integer array type.
Change the type of pv! to Map and keep it multiple.