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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Usage of Power BI Rest API in Power Automate

Hi Everyone, I am trying to use these two Power BI Rest API's in Power Automate.

  • Groups GetUnusedArtifactsAsAdmin
  • Groups GetGroupsAsAdmin

I know this can be done with the help of the custom connectors. I'm using Authentication Type: API Key. Then paste the URL of the API. Till here the steps are same in both API calls. But the problem arrives in 1st API i.e Groups GetUnusedArtifactsAsAdmin

URL:  https://api.powerbi.com/v1.0/myorg/admin/groups/{groupId}/unused,

Here the {groupId} must be inserted, but I want this {groupId} to be dynamic to obtain results for all the workspaces.

I don't have any clues how to proceed. Can any one help me out here?

thanks. 

1 ACCEPTED SOLUTION
jaweher899
Impactful Individual
Impactful Individual

To make the groupId dynamic, you can use the Power Automate flow "GetGroupsAsAdmin" API to retrieve the groupIds of all the workspaces in your organization. You can use a loop in Power Automate to iterate through each groupId and make a call to the "GetUnusedArtifactsAsAdmin" API with the specific groupId. You can store the response of each API call in a collection or data structure and use it as per your requirement.

This way, you can retrieve the unused artifacts of all the workspaces in your organization dynamically using Power Automate.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thank you very much @jaweher899. I will try it. 🙂

jaweher899
Impactful Individual
Impactful Individual

To make the groupId dynamic, you can use the Power Automate flow "GetGroupsAsAdmin" API to retrieve the groupIds of all the workspaces in your organization. You can use a loop in Power Automate to iterate through each groupId and make a call to the "GetUnusedArtifactsAsAdmin" API with the specific groupId. You can store the response of each API call in a collection or data structure and use it as per your requirement.

This way, you can retrieve the unused artifacts of all the workspaces in your organization dynamically using Power Automate.

Anonymous
Not applicable

Hi Jaweher, 

Thanks for your help. I made the like you said with a bit of my own flavour.

Wolf1997_0-1676078039117.png

  • HTTP is just to get Workspaces via Groups GetGroupsAsAdmin API
  • In the next step "Parse JSON", all the data is just being parsed

Wolf1997_1-1676078283159.png

 

  • In the last "Apply to each" Loop, I'm getting the value from the parsed JSON step. In this case I only need ID (Group ID)

Wolf1997_2-1676078321676.png

  • Now the ID will be pasted in HTTP Connector, where I have used the dynamic ID as (which can be seen).

Wolf1997_3-1676078464621.png

  • Now I want to parse all the data and store it on Excel and that's how I am doing it. In the loop I also added "Parse JSON" Step and "Add to excel step". By keeping in mind, by every loop the data will parsed and stored in Excel sheet.

 

It's showing me the correct result which I watned but shows me an error also that Action Failed. No dependent actions succeceded. 

P:S I tried to put the last two steps out of loop but then it doesn't work at all. This working and showing correct results with an error msg.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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