0

I have a list of players which belong to a group each. How can I use a filter to list the users per group?

 [   {
     "UserID": 61267,
     "FullName": "Steve",
     "Permissions": [
       {
         "PermssionType": 1,
         "PermssionStr": "team alpha"
       }
     ]   },   {
     "UserID": 61268,
     "FullName": "George",
     "Permissions": [
       {
         "PermssionType": 1,
         "PermssionStr": "team alpha"
       },
       {
         "PermssionType": 2,
         "PermssionStr": "team beta"
       }
     ]   },   {
     "UserID": 50825,
     "FullName": " Gene",
     "Permissions": [
       {
         "PermssionType": 1,
         "PermssionStr": "team alpha"
       },
       {
         "PermssionType": 2,
         "PermssionStr": "team beta"
       }
     ]   } ]

I'm looking for this result:

  • team alpha

    • Gene

    • George

    • Steve

  • team beta

    • Gene

    • George

keylist
  • 1
  • 2
  • You can use lodash, here is another topic for grouping elements: https://stackoverflow.com/questions/23600897/using-lodash-groupby-how-to-add-your-own-keys-for-grouped-output You can also check this, its really useful: https://dustinpfister.github.io/2018/08/02/lodash_groupby/ – rcanpahali Dec 14 '18 at 08:38
  • perhaps you haven't understood my mind well – keylist Dec 18 '18 at 02:10

0 Answers0