Skip to main content

Notifications

Power Platform Community / Forums / Microsoft Dataverse / Retrieve all used enti...
Microsoft Dataverse
Unanswered

Retrieve all used entities/attributes

Posted on by 12
We have Dynamics 365 and we also develop and run PowerApps apps and PowerAutomate flows. We want to analyze dataverse usage, get to know the list of entities and attributes that are used. We want to automate this process: retrieve analytics via API calls from PowerShell, store the results in a db and analyze history.
 
Here is a high level code, courtesy of Claude.ai:
 
# Import required modules
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber

# Connect to your Power Platform environment
Add-PowerAppsAccount

# Set your environment ID
$environmentId = "your-environment-id"

# Get Usage Analytics data
$usageAnalytics = Get-PowerAppAnalyticsEntityUsageMetrics -EnvironmentId $environmentId (period parameters here..)

# Process Usage Analytics data
$usedEntities = @()
$usedAttributes = @()

foreach ($entity in $usageAnalytics.Entities) {
$usedEntities += $entity.EntityName
foreach ($attribute in $entity.Attributes) {
$usedAttributes += "$($entity.EntityName).$($attribute.AttributeName)"
}
}
 
Has anybody worked some sort of solution like this? 
Looking for any feedback on this to support ideation over here.
 
Thank you very much!
 
 
Categories:
  • Suggested answer
    bscarlavai33 Profile Picture
    bscarlavai33 193 on at
    Retrieve all used entities/attributes
    I believe Claude.ai just made up the "Get-PowerAppAnalyticsEntityUsageMetrics" function. It would be nice if it existed though. Someone built an XrmToolbox tool to do this, called AttributeUsageInspector. The code is open source so you could get inspiration from there.

    Tool: https://www.xrmtoolbox.com/plugins/MscrmTools.AttributeUsageInspector/

    Github: https://github.com/MscrmTools/MscrmTools.AttributeUsageInspector
     
     
  • Shashank Bhide Profile Picture
    Shashank Bhide 746 on at
    Retrieve all used entities/attributes
    not sure what's the objective here, but have you tried to use the OOB admin center reports to see if those give you the details. 
  • Suggested answer
    FLMike Profile Picture
    FLMike 21,712 on at
    Retrieve all used entities/attributes
    Hi,
     
    What exactly are you looking for?
     
    Are you trying to track when people change/modify the Tables? The Data? when they do any action?
     
    No I wouldn't do what you are doing, but I don't understand the holistic thing you want to do.
     
    Are you trying to understand how they are used by Apps and Flows and When etc?
     
     

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update 9/9/24…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,690

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard

Featured topics