AnsweredAssumed Answered

Loop through jdbcQuery Context Variables to build JSON

Question asked by UoC on Sep 18, 2015
Latest reply on Sep 21, 2015 by goeer03

Hi All.

 

It has been suggested that I can build a JSON response from a jdbcQuery by storing the results in the Query Context Variables, and using the Run Assertions for Each Item and a Set Context Variable.

However, I cant seem to piece this together.

 

One thing that stops me is that the Set Context Variable assertion does not allow me to do this

${jdbcQuery.code_type[${example.iterations}]}

${jdbcQuery.another_column[${example.iterations}]}

 

If it did I was thinking I could build the json response for each row from the queries resultset.

 

I would want to use the [${example.iterations} for the values for all the other jdbcQuery context variables that have been set.

 

So this seems impossible ...

What would be the correct/suggested way to work with the multivalued jdbcQuery.contextVariables to get the results of multiple rows and columns from a single query into JSON response?

 

Please help.

 

Many Thanks,

Paul

 

In the image below you can see where I would like to open/close the [brackets] but policy manager disables the 'OK' button

screenshot.PNG

Outcomes