Skip to content

Instantly share code, notes, and snippets.

@joerodgers
Created November 5, 2020 14:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joerodgers/b5d1429ca12f43a7fa426e634afbe325 to your computer and use it in GitHub Desktop.
Save joerodgers/b5d1429ca12f43a7fa426e634afbe325 to your computer and use it in GitHub Desktop.
Kicking the tires on the new APIs for pulling Flow associations on a list in SPO as well as pulling all available Flow templates.
Connect-PnPOnline -Url "https://m365x5551212.sharepoint.com/sites/Test" -SPOManagementShell
$ctx = Get-PnPContext
$list = Get-PnPList -Identity "Shared Documents"
$flowInstances = $list.SyncFlowInstances()
$flowTemplates = $list.SyncFlowTemplates($null)
$ctx.Load($flowTemplates)
$ctx.Load($flowInstances)
Invoke-PnPQuery
$flowInstanceData = $flowInstances.SynchronizationData | ConvertFrom-Json | SELECT -ExpandProperty Value
$flowInstanceProperties = $flowInstanceData | SELECT -ExpandProperty properties
<# $flowInstanceProperties example objects
apiId : /providers/Microsoft.PowerApps/apis/shared_logicflows
displayName : Enterprise Projects - Project Added
userType : Owner
state : Started
plan : NotSpecified
parameters : @{$authentication=; $connections=}
createdTime : 2020-10-20T13:58:23.1661049Z
lastModifiedTime : 2020-10-29T19:44:13.8463615Z
environment : @{name=Default-de38fe1a-3ce0-4b4e-93a1-49593f64a882; type=Microsoft.ProcessSimple/environments;
id=/providers/Microsoft.ProcessSimple/environments/Default-de38fe1a-3ce0-4b4e-93a1-49593f64a882}
definitionSummary : @{triggers=System.Object[]; actions=System.Object[]}
provisioningMethod : FromDefinition
flowFailureAlertSubscribed : True
runtimeConfiguration : @{collections=}
apiId : /providers/Microsoft.PowerApps/apis/shared_logicflows
displayName : Enterprise Projects - Project Modified
userType : Owner
state : Started
plan : NotSpecified
parameters : @{$authentication=; $connections=}
createdTime : 2020-10-20T14:04:30.6401761Z
lastModifiedTime : 2020-10-29T19:46:26.834807Z
environment : @{name=Default-de38fe1a-3ce0-4b4e-93a1-49593f64a882; type=Microsoft.ProcessSimple/environments;
id=/providers/Microsoft.ProcessSimple/environments/Default-de38fe1a-3ce0-4b4e-93a1-49593f64a882}
definitionSummary : @{triggers=System.Object[]; actions=System.Object[]}
provisioningMethod : FromDefinition
flowFailureAlertSubscribed : True
runtimeConfiguration : @{collections=}
#>
$flowTemplateData = $flowTemplates.SynchronizationData | ConvertFrom-Json | SELECT -ExpandProperty Value
$flowTemplateProperties = $flowTemplateData | SELECT -ExpandProperty properties
<# $flowTemplateProperties example objects
categoryNames : {aibuilder, productivity, spointegration, spoautomatictrigger...}
statistics : @{instantiations=926}
publishedTime : 2020-10-27T03:59:15.9575875Z
displayName : Start AI Builder form processing when a new file is created
galleryName : public
summary : Extract text from images or PDFs to columns in a SharePoint library by applying an AI Builder form processing model.
description : Extract text from images or PDFs to columns in a SharePoint library by applying an AI Builder form processing model.
author : @{displayName=Microsoft; source=microsoft}
connectionReferences : @{shared_sharepointonline=; shared_commondataserviceforapps=}
definitionSummary : @{triggers=System.Object[]; actions=System.Object[]}
categoryNames : {approval, notifications, socialMedia, spointegration...}
statistics : @{instantiations=354}
publishedTime : 2018-04-24T00:25:49.1364136Z
displayName : Post a message to Teams for the selected file
galleryName : public
summary : Post a message to Teams with a link to the selected file in SharePoint.
description : Post a message to Teams with a link to the selected file in SharePoint.
author : @{displayName=Microsoft; source=microsoft}
connectionReferences : @{shared_sharepointonline=; shared_teams=}
metadata : @{SPOListsPriority=50}
definitionSummary : @{triggers=System.Object[]; actions=System.Object[]}
categoryNames : {SPOLibraries, DesignerUnsupported, spointegration, spomanualtrigger}
statistics : @{instantiations=104}
publishedTime : 2018-04-24T00:25:49.3708142Z
displayName : Post a message to Yammer for the selected file
galleryName : public
summary : Post a message to Yammer with a link to the selected item in SharePoint.
description : Post a message to Yammer with a link to the selected item in SharePoint.
author : @{displayName=Microsoft; source=microsoft}
connectionReferences : @{shared_sharepointonline=; shared_yammer=}
metadata : @{SPOListsPriority=70}
definitionSummary : @{triggers=System.Object[]; actions=System.Object[]}
#>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment