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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.