Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

Get Datasource from Group - help parsing the JSON in PowerShell

Hi all

 

When quering Get Datasource from Group in PowerShell the response is nested JSON. I´m not very good with PowerShell so I´m having problems picking out the values that I need. What I´m after is the url and the datasourceType. Below is a sample response. If I try to convert it to csv it will create two columns @odata.context and value which does not traverse all the depths of the JSON. I don´t know how to pick out the relevant values. I have tried $MyVariable[0].[value][0].... but it says the array is empty. 

 

What I´m ultimetly trying to do is to grab the url for SharePoint sources, replace parts of the string and update it via the update datasource endpoint

 

Hope someone can help.

 

{
"@odata.context":"http://wabi-europe-north-b-redirect.analysis.windows.net/v1.0/myorg/groups/WORKSPACEID/$metadata#dat...":[
{
"datasourceType":"SharePointList","connectionDetails":{
"url":"https://COMPANY.sharepoint.com/"
},"datasourceId":"DATASOURCEID","gatewayId":"GATEWAYID"
}
]
}

1 REPLY 1
lbendlin
Super User
Super User

How is this related to Power BI?

 

Also, have you tried to do this in Power Query?  It guides you through the JSON structure and allows you to pick the fields you need .

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.