Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Nicely format Flows (JSON) when using solutionpackager.exe /action:extract

(1) ShareShare
ReportReport
Posted on by

When "exploding" a solution that contains flows/PowerAutomates the JSON is held on a single line and is hard to diff.

i.e. when a solution contains flows (or SLAs) and the solution is expanded 

SolutionPackager.exe /action:extract /zipfile:CustomSLA_1_0_0_1.zip

The exported flows are not nicely formatted and are very difficult to compare over different revisions of the SLA logic.  One of the key benefits of using the solution packager is change tracing, which is being made much more difficult since the extract flow JSON is in one long line as demonstrated below.    

{"properties":{"connectionReferences":{"shared_commondataserviceforapps":{"runtimeSource":"embedded","connection":{},"api":{"name":"shared_commondataserviceforapps"}}},"definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"},"$authentication":{"defaultValue":{},"type":"SecureObject"}},"triggers":{"[Do not delete or update] Invoked Through Execution Workflow Call":{"type":"OpenApiConnectionWebhook","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"SubscribeWebhookTrigger","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"subscriptionRequest/message":3,"subscriptionRequest/entityname":"slakpiinstance","subscriptionRequest/scope":4,"subscriptionRequest/filteringattributes":"versionnumber,createdon"},"authentication":"@parameters('$authentication')"}}},"actions":{"[Do not delete or update] Switch":{"runAfter":{},"cases":{"[Do not delete] Is Near Non Compliance.":{"case":2,"actions":{"Update_a_record":{"runAfter":{},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"UpdateRecord","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"incidents","recordId":"@triggerOutputs()?['body/regardingentityid']","item/pgc_ragfirstresponse":289920001},"authentication":"@parameters('$authentication')"}}}},"[Do not delete] Is Succeeded.":{"case":4,"actions":{}},"[Do not delete]Is Non-compliant.":{"case":1,"actions":{}}},"default":{"actions":{}},"expression":"@triggerOutputs()?['body/status']","type":"Switch"}},"outputs":{}}},"schemaVersion":"1.0.0.0"}

Can the solution packager output formatted JSON that is friendly to read, and more suitable for standard comparison tools (e.g, diff, WinMerge, etc)? e.g.

 

{
 "properties": {
 "connectionReferences": {
 "shared_commondataserviceforapps": {
 "runtimeSource": "embedded",
 "connection": {},
 "api": {
 "name": "shared_commondataserviceforapps"
 }
 }
 },
 "definition": {
 "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
 "contentVersion": "1.0.0.0",

 

  • Community Power Platform Member Profile Picture
    on at
    Re: Nicely format Flows (JSON) when using solutionpackager.exe /action:extract

    Thanks @ScottDurow.  I created a powershell (v6+) script that reformats the JSON.

     

    It would be great if this would be done as standard as part of the solutionpackager.exe /action:extract though. 

     

  • ScottDurow Profile Picture
    1,039 on at
    Re: Nicely format Flows (JSON) when using solutionpackager.exe /action:extract

    afik there is no way to do this by default. I run lots of scripts after the Solution Packager has unpacked the files to make them easier to diff in source control - prettifying JSON is one of the steps. You can do this with the indent argument of :

    https://www.newtonsoft.com/json/help/html/SerializeObject.htm

     

    hope this helps

    Scott

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 72

Overall leaderboard