Skip to main content

Notifications

Power Apps - Microsoft Dataverse
Unanswered

Retrieve all used entities/attributes

Like (2) ShareShare
ReportReport
Posted on 3 Sep 2024 18:04:22 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 483 on 06 Sep 2024 at 13:01:29
    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 927 on 04 Sep 2024 at 12:43:08
    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 27,286 on 04 Sep 2024 at 04:19:56
    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?
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #13 Writing Effective Answers…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,696

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,456

Leaderboard

Featured topics

Loading complete