Retrieve a dictionary from a list of dictionaries by filtering the list with a parameter in the dictionary

Hi,

I have a list of dictionaries provided by an SPROC's output, I need to filter the list from a parameter inside the dictionary and retrieve one of the dictionary. 

My list looks like this 

List of Dictionary: 2 items Dictionary  American : 1

                                                      Asian: 0

                                                     Code: "32" 

                                        Dictionary  American : 1

                                                      Asian: 0

                                                     Code: "33" 

I want to filter the Dictionary by using the parameter Code.My code looks as follows

local!dataSubset: todatasubset(
index(
local!spResult.result,
wherecontains(
"32",
tostring(local!spResult.result.Code)
)
),
local!pagingInfo
),

where local!spResult.result is the local variable storing the SPROC'S output. 

 

Regards,

Abhishek Gaddam.

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Hey josep, I think I was not clear with the question , I am facing the problem with retrieving one dictionary from the list of dictionaries as the whole data is coming as one set i.e if I try to get the second dictionary values by doing local!spResult.result[2], I get an error saying invalid index and when tried usinglocal!spResult.result[1] i get the whole list so the problem is with converting list of dictionories into array list.