You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How to use group by for more than one element

edited Nov 27, 2021 5:20AM in Integration 3 comments

Summary:

How to use group by for more than one element

Content (required):

Hi Expert,

I am trying to get unique record and for that i want to group by two element .Below is my payload

{

  "Input":[

   {

     "Age":"25",

     "Name":"John"

   },

   {

     "Age":"34",

     "Name":"Bikram"

   },

   {

     "Age":"25",

     "Name":"John"

   }

  ]

}

Here i want to group by name and age.

Below is my xslt code,but i'm not getting the exact output

<xsl:template match="/" xml:id="id_11">

       <nstrgmpr:executeResponse xml:id="id_12">

          <nstrgdfl:response-wrapper xml:id="id_21">

             <xsl:for-each-group xml:id="id_23" select="/nstrgmpr:execute/nstrgdfl:request-wrapper/nstrgdfl:Input" group-by="nstrgdfl:Name,nstrgdfl:Age">

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!