cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JohnMo11
New Member

Adding column to table from nested json

After having benefitted so often from this community when building flows in the last year or so (and learned so much from the questions and solutions offered), I'm stuck now, so attempting my first post hoping someone can help me out here.

 

I'm trying to create a flow to build a table with users and assigned licenses, extracting it via GraphAPI. However, I'm struggling to get the nested JSON show up as an additional column. What would be the best approach (without doing many for each loops)?

 

Table I would like to get as a result

userPrincipalName

EMS-E3

O365-E3

[Any additional license from SP list in future]

j.smith@domain.com

1

1

0

j.doe@domain.com

0

1

0

f.bar@domain.com

0

0

0

 

 

User List with assignments JSON (extracted via Graph API)

 

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(userPrincipalName,assignedLicenses)",
  "value": [
    {
      "userPrincipalName": "j.smith@domain.com",
      "assignedLicenses": [
          {
            "disabledPlans": [
            "bea4c11e-220a-4e6d-8eb8-8ea15d019f90"
          ],
          "skuId": "efccb6f7-5641-4e0e-bd10-b4976e1bf68e"
        },
        {
          "disabledPlans": [
            "aebd3021-9f8f-4bf8-bbe3-0ed2f4f047a1",
            "8c7d2df8-86f0-4902-b2ed-a0458298f3b3"
          ],
          "skuId": "6fd2c87f-b296-42f0-b197-1e91e994b900"
        },
        {
          "disabledPlans": [],
          "skuId": "f30db892-07e9-47e9-837c-80727f46fd3d"
        }
      ]
    },
    {
      "userPrincipalName": "j.doe@domain.com",
      "assignedLicenses": [
        {
          "disabledPlans": [
            "aebd3021-9f8f-4bf8-bbe3-0ed2f4f047a1",
            "8c7d2df8-86f0-4902-b2ed-a0458298f3b3"
          ],
          "skuId": "6fd2c87f-b296-42f0-b197-1e91e994b900"
        }
      ]
    },
    {
      "userPrincipalName": "f.bar@domain.com",
      "assignedLicenses": []
    }
  ]
}

 

 

License charge table (from a sharepoint list used)

 

{
    "value": [
      {
        "ID": 1,
        "Title": "Enterprice Mobility + Security E3",
        "ShortName": "EMS-E3",
        "SkuGUID": "efccb6f7-5641-4e0e-bd10-b4976e1bf68e",
        "LicenseCost": 10
      },
      {
        "ID": 2,
        "Title": "Office 365 E3",
        "ShortName": "O365-E3",
        "SkuGUID": "6fd2c87f-b296-42f0-b197-1e91e994b900",
        "LicenseCost": 20
      }
    ]
  }

 

 

 

 

 

Thanks in advanced for any tips and tricks. 

 

John

2 REPLIES 2
DamoBird365
Community Champion
Community Champion

Hi @JohnMo11 

 

Did you get anywhere with this?  I think you will have to use at least one apply to each, possibly a nested.  I was going to give it a go but I noticed you posted this a week ago and wasn't sure if it was still a requirement?

 

Damien

JohnMo11
New Member

Thanks @DamoBird365 for your response. I haven't been able to spent any more time on this week, so if you have some suggestions, love to hear them.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (18,300)